-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Remove unnecessary join when filtering on relationship id #3922
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
base: main
Are you sure you want to change the base?
Conversation
6042c1e
to
12cfabd
Compare
// is the attribute of Collection type? | ||
boolean isPluralAttribute = model instanceof PluralAttribute; | ||
|
||
if (propertyPathModel == null && isPluralAttribute) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
propertyPathModel being null is no longer issue in hibernate
Thanks a lot. Does this optimization also work for composite id's and/or parts of a composite identifier? |
It should. I've added some more tests. Unfortunately
Test also fails without my changes to query utils |
Looks like a Hibernate issue. The query is:
Exception (it's a masked
I've reproduced the issue just using Also, noteworthy, when introducing |
Closes spring-projects#3349 Signed-off-by: Jakub Soltys <[email protected]>
I am not sure from the last comment whether there is something that I should change to move this PR forward? |
If you want, please report the problem to the Hibernate team using code from the reproducer. Hibernate folks are somewhat picky and want folks to use their reproducer templates. In recent reports, the moment the've seen Spring being involved, they backed off immediately and so I am tired filing bug reports there. Rather, I focus on investigating the cause to see whether there is something we can fix on our side (which we can't). Circling back to the original request, I suggest to wait for a Hibernate fix before we proceed. Shipping a feature where composite Id's cannot be used feels like an incomplete feature from our side. |
Ok I will try to report it using their template, although I feel what you are saying. |
Technically, it isn't a blocker, but once we're going to advertise the feature it receives more attention and specific cases are going to fail creating a hard time for users wanting to use the feature. Let's get some indication from the Hibernate team how it goes to get a better understanding of how and when we can progress. |
Closes #3349