Aleksandr B. (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-16856 (
https://hibernate.atlassian.net/browse/HHH-16856?atlOrigin=eyJpIjoiNGIxZW...
)
Re: Hibernate incorrectly does regular JOIN instead of LEFT JOIN when moving from Spring
Boot 3.1.0 to 3.1.1 (
https://hibernate.atlassian.net/browse/HHH-16856?atlOrigin=eyJpIjoiNGIxZW...
)
This is absolutely not a hibernate relative bug. I’d say that this is not a bug at all.
Spring Data (starting from 3.x) parses your @Query string and generates a new query.
When you create PageRequest you should use aliases from the the query: r.name instead of
role.name :
Order order = new Order(ASC, "r.name");
In your case, spring data sees, that “left join” is absolutely useless and removes it from
the query. Then spring data adds a new inner join with Role to satisfy your Sort request.
(
https://hibernate.atlassian.net/browse/HHH-16856#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16856#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100227- sha1:3bc807d )