What's the difference in how has-one and has-many work? I have a table trel_pers_name where the :alias is set, and I have a tdta_personen which refers to trel_pers_name using a has-many. Now with that has-many, and calling (select tdta_personen (with trel_pers_name)) Korma selects the first few trel_pers_name entries where the foreign key is NULL. As soon as I replace the has-many with a has-one, though, the result is perfectly fine - with the difference, of course, that I only get the first entry.
On the high level, has-one executes single query using JOIN and has-many queries children with a separate query. Have you looked at the generated SQL e.g. using dry-run?
What's the difference in how
has-one
andhas-many
work? I have a tabletrel_pers_name
where the:alias
is set, and I have atdta_personen
which refers totrel_pers_name
using ahas-many
. Now with that has-many, and calling(select tdta_personen (with trel_pers_name))
Korma selects the first fewtrel_pers_name
entries where the foreign key is NULL. As soon as I replace thehas-many
with ahas-one
, though, the result is perfectly fine - with the difference, of course, that I only get the first entry.