-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug: fetch and where with formula join will produce incorrect joins #2773
base: master
Are you sure you want to change the base?
Bug: fetch and where with formula join will produce incorrect joins #2773
Conversation
@rbygrave any ideas on this? |
Sorry, I've been focused on the enhancement stuff. Looking to get a release out and then I hope to get some time to look at this. |
I feel that we really need a logical version of |
…ce incorrect joins
c8e325c
to
932c8a9
Compare
When using a fetch and where on a formula joined field (maybe others are also affected) in a query,
the joins are build incorrectly.
The table alias is wrong, if you have a where clause with 3 path components and a fetch with 2.
See test case with childPerson -> parentPerson -> effectiveBean
The problem is somewhere located here:
https://github.com/ebean-orm/ebean/blob/master/ebean-core/src/main/java/io/ebeaninternal/server/query/SqlTreeBuilder.java#L680
"where" generates an extra join which is effectivly added to the root bean und not to the already existing child (from the select/fetch)