Tassilo Karge (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5f50ce4...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZDliNjc0NTlh...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16512?atlOrigin=eyJpIjoiZDliNj...
) HHH-16512 (
https://hibernate.atlassian.net/browse/HHH-16512?atlOrigin=eyJpIjoiZDliNj...
) Bidirectional OneToOne association produces wrong isNull predicate in criteria query (
https://hibernate.atlassian.net/browse/HHH-16512?atlOrigin=eyJpIjoiZDliNj...
)
Change By: Tassilo Karge (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5f50ce4...
)
The same fails in Hibernate 5.6 and 6.2
Setup: Two classes A, B declaring a bidirectional OneToOne relation to one another
(attributes A.b, B.a), class A declares relation with a join column (named B ) and class B
declares relation as mappedBy b.
Hibernate 5.6:
A query that checks {{isNull('a')}} on B (alias b0) produces the where-clause
{{b0.id is null}} instead of joining with A (alias a0, join criterion {{a0.b = b0.id}})
and querying {{a0.id is null}}.
When writing a query that checks isNull(A_.b), everything is fine.
Hibernate 6.2
A query that checks {{isNull('a')}} on B (alias b0) produces an inner join with A
(alias a0, join criterion {{a0.b = b0.id}}) and querying {{a0.id is null}}. The inner
join filters all b0 which are not connected to a0. It should be a {{left join}} in order
to fulfill the query.
(
https://hibernate.atlassian.net/browse/HHH-16512#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16512#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#100223- sha1:cdc0af3 )