[hibernate-issues] [JIRA] (HHH-14134) Querying with "IS NOT EMPTY" jpql against a @OneToMany mappedBy collection is failing in mysql for Hibernate v. 5.4.11 and up
Kean Erickson (JIRA)
jira at hibernate.atlassian.net
Sat Aug 1 01:35:26 EDT 2020
Kean Erickson ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A3afe9d63-4a56-40b5-be3e-001c223765a9 ) *commented* on HHH-14134 ( https://hibernate.atlassian.net/browse/HHH-14134?atlOrigin=eyJpIjoiYjM4ZTA5ZTQwYWJjNDVhNzlkZGRmY2NjNjNiOTdhYjQiLCJwIjoiaiJ9 )
Re: Querying with "IS NOT EMPTY" jpql against a @OneToMany mappedBy collection is failing in mysql for Hibernate v. 5.4.11 and up ( https://hibernate.atlassian.net/browse/HHH-14134?atlOrigin=eyJpIjoiYjM4ZTA5ZTQwYWJjNDVhNzlkZGRmY2NjNjNiOTdhYjQiLCJwIjoiaiJ9 )
It looks like extra parentheses are added to the select columns corresponding to an “collection IS NOT EMPTY” check in JPQL, where the collection is a @OneToMany with mappedBy. Mysql doesn’t like these added parens. The query originally in 5.4.10 came out as
>
>
>
> select * from a where not (exists (
> select collection.a_id, collection.b_id from collection where a.id (
> http://a.id ) = collection.a_id));
>
>
But in 5.4.11 it resolves to
>
>
>
> select * from a where not (exists (
> select (collection.a_id, collection.b_id) from collection where a.id (
> http://a.id ) = collection.a_id));
>
>
( https://hibernate.atlassian.net/browse/HHH-14134#add-comment?atlOrigin=eyJpIjoiYjM4ZTA5ZTQwYWJjNDVhNzlkZGRmY2NjNjNiOTdhYjQiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14134#add-comment?atlOrigin=eyJpIjoiYjM4ZTA5ZTQwYWJjNDVhNzlkZGRmY2NjNjNiOTdhYjQiLCJwIjoiaiJ9 )
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.core&referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail ) or iOS ( https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=EmailNotificationLink&mt=8 ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100140- sha1:33445dc )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200801/f2c8344d/attachment.html
More information about the hibernate-issues
mailing list