Mike Conner (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=62fe3d3...
) *commented* on HHH-16080 (
https://hibernate.atlassian.net/browse/HHH-16080?atlOrigin=eyJpIjoiZDE3Nz...
)
Re: UnknownTableReferenceException with JPQL query of Entity with unidirectional OneToOne
mapping (
https://hibernate.atlassian.net/browse/HHH-16080?atlOrigin=eyJpIjoiZDE3Nz...
)
I stumbled across a workaround. If you use an attribute of the left-joined entity, rather
than the entity to test for null, no UnknownTableReferenceException is thrown, and the
query works properly. So, instead of:
select thing from Thing thing
left join thing.thingStats thingStats
where thingStats is null or thingStats.rejectedCount = 0
Use an attribute on the left-joined entity:
select thing from Thing thing
left join thing.thingStats thingStats
where thingStats.thingPk is null or thingStats.rejectedCount = 0
This only works when the joined entity has a non-nullable attribute (e.g.: a PK).
(
https://hibernate.atlassian.net/browse/HHH-16080#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16080#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#100214- sha1:01e0849 )