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
I'm using posgres and your work around didn't fix it for me.
I've been able to make it work by doing .leftJoinAndMapMany for one-to-many relation entity and then doing .leftJoinAndMapOne for nested relation (it was many-to-one in my case).
Make sure to providecondition parameter to both mappers, it doesn't work otherwise.
I'm not sure this workaround provides at least half decent SQL to be honest, so use it at your own risk.
+1 for making such a join to work with simple .leftJoinAndSelects.
Issue Description
leftJoinAndSelect() won't use proper parameter.
Expected Behavior
This is a common comment model, that i want to get result like this:
Steps to Reproduce
My Comment entity:
I use query builder like this:
Then i get sql:
Notice that on line 3:
This will get all the replys from
Comment
, and lead to all thereplys.author
becomes the first user who given reply.Work Around
I have figured it out by change query builder to:
And the generated sql will be:
Still, I want to know is there a better way to do it?
My Environment
Additional Context
Relevant Database Driver(s)
aurora-data-api
aurora-data-api-pg
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: