Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYzgxN2IxYjQx...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16202?atlOrigin=eyJpIjoiYzgxN2...
) HHH-16202 (
https://hibernate.atlassian.net/browse/HHH-16202?atlOrigin=eyJpIjoiYzgxN2...
) @OrderBy not applied to collections when @Fetch(value = FetchMode.SUBSELECT) (
https://hibernate.atlassian.net/browse/HHH-16202?atlOrigin=eyJpIjoiYzgxN2...
)
Change By: Andrea Boriero (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Given
{code:java}@Entity(name = "Parent")
public static class Parent {
....
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL)
@Fetch(value = FetchMode.SUBSELECT)
@OrderBy("name ASC")
private List<Child> children = new ArrayList<>();
}
@Entity(name = "Child")
public static class Child {
...
@ManyToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "parent_id", nullable = false)
private Parent parent;
}
{code}
the query
{code:java}List<Parent> parents = session.createQuery( "select p from Parent
p", Parent.class ).list();{code}
does not return the children ordered by name;
(
https://hibernate.atlassian.net/browse/HHH-16202#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16202#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 )