Steve Webber (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=63f359a...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYjRkMmVlMmE2...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16213?atlOrigin=eyJpIjoiYjRkMm...
) HHH-16213 (
https://hibernate.atlassian.net/browse/HHH-16213?atlOrigin=eyJpIjoiYjRkMm...
) @OneToMany relationship not returning children when use "is null" clause on
@ManyToOne relationship (
https://hibernate.atlassian.net/browse/HHH-16213?atlOrigin=eyJpIjoiYjRkMm...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Components: hibernate-core
Created: 21/Feb/2023 06:59 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...
)
Have a problem that seems to be caused by a combination of hibernate-core 6 and
FetchMode.SUBSELECT. Don’t get this problem with hibernate-core 5, or if I use
FetchMode.SELECT or FetchMode.JOIN. Difficult to explain. Hopefully the test case on
GitHub provides a suitable example:
https://github.com/s-webber/hibernate-test-case-orm-6-subselect-children-... (
https://github.com/s-webber/hibernate-test-case-orm-6-subselect-children-... )
Description:
Have three entities - Parent , Child and GrandParent.
Parent has @ManyToOne relationship on entity GrandParent.
Parent has @OneToMany relationship on entity Child.
Try to select from Parent where GrandParent is null (do this using
query.where(criteriaBuilder.isNull(root.get("grandParent"))) ).
Expect the Parent that is returned to be associated with 3 Child entities but is
associated with none.
See test case:
https://github.com/s-webber/hibernate-test-case-orm-6-subselect-children-... (
https://github.com/s-webber/hibernate-test-case-orm-6-subselect-children-... )
(
https://hibernate.atlassian.net/browse/HHH-16213#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16213#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#100216- sha1:3fa9804 )