Steve Webber (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63f359a...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZjM2OGNiYTAw...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16203?atlOrigin=eyJpIjoiZjM2OG...
) HHH-16203 (
https://hibernate.atlassian.net/browse/HHH-16203?atlOrigin=eyJpIjoiZjM2OG...
) @OrderBy annotation is ignored when using FetchMode.SUBSELECT (
https://hibernate.atlassian.net/browse/HHH-16203?atlOrigin=eyJpIjoiZjM2OG...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Components: hibernate-core
Created: 20/Feb/2023 04:46 AM Environment: hibernate core 6.1.7.Final
java 17.0.6
H2 database 2.1.214
windows operating system Priority: Major Reporter: Steve Webber (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63f359a...
)
I have an entity that has a @OneToMany relationship that uses both FetchMode.SUBSELECT and
an @OrderBy. The @OrderBy is not being used. Instead of child entities being in the order
specified by the @OrderBy they appear in the order they were inserted into the database.
The child entities do return in the order I expect when I use FetchMode.SELECT or
FetchMode.JOIN.
The child entities did return in the order I expect when I used FetchMode.SUBSELECT with
Hibernate 5.
Have created a testcase on GitHub that demonstrates this problem:
https://github.com/s-webber/hibernate-test-case-orm-6-subselect-orderby (
https://github.com/s-webber/hibernate-test-case-orm-6-subselect-orderby )
(
https://hibernate.atlassian.net/browse/HHH-16203#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16203#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#100217- sha1:d96fecc )