You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Querying this entity does not work properly with joined loading strategy. In my database there are two records with the same user id (1) but different tenant ids (1 and 2). Running the query below works fine, both records are returned:
If I uncomment the loading strategy entry above then only the first record is returned. The same happens if I set the loading strategy within @manytoone decorator.
It is worth noting that even in these cases the SQL statement returns both two records, the issue is somewhere around mapJoinedProps (see @mikro-orm/knex/AbstractSqlDriver.js), because getCompositeKeyHash utility does not recognize the embedded tenant object as entity and the generated hash is
1~~~[Object object]
for both two records (1 is the user id).
Do I failed to add some property somewhere or is this really a buggy behavior?
Versions
Dependency
Version
node
14
typescript
yes
mikro-orm
4.5.5
your-driver
postgresql
The text was updated successfully, but these errors were encountered:
I have the following user-tenant entity:
Querying this entity does not work properly with joined loading strategy. In my database there are two records with the same user id (1) but different tenant ids (1 and 2). Running the query below works fine, both records are returned:
If I uncomment the loading strategy entry above then only the first record is returned. The same happens if I set the loading strategy within @manytoone decorator.
It is worth noting that even in these cases the SQL statement returns both two records, the issue is somewhere around mapJoinedProps (see @mikro-orm/knex/AbstractSqlDriver.js), because getCompositeKeyHash utility does not recognize the embedded tenant object as entity and the generated hash is
for both two records (1 is the user id).
Do I failed to add some property somewhere or is this really a buggy behavior?
Versions
The text was updated successfully, but these errors were encountered: