[hibernate-issues] [JIRA] (HHH-14148) Invalid SQL when null precedence, @OrderBy and entity graph are used
Amr Mostafa (JIRA)
jira at hibernate.atlassian.net
Tue Aug 11 19:18:49 EDT 2020
Amr Mostafa ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A4af3ec09-e6c6-4bc1-a4cc-7a112dc7970d ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZWEyMWMzMWU3NDhmNGY1MThkZDhlZTNiOGU3NzA0ZjUiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14148?atlOrigin=eyJpIjoiZWEyMWMzMWU3NDhmNGY1MThkZDhlZTNiOGU3NzA0ZjUiLCJwIjoiaiJ9 ) HHH-14148 ( https://hibernate.atlassian.net/browse/HHH-14148?atlOrigin=eyJpIjoiZWEyMWMzMWU3NDhmNGY1MThkZDhlZTNiOGU3NzA0ZjUiLCJwIjoiaiJ9 ) Invalid SQL when null precedence, @OrderBy and entity graph are used ( https://hibernate.atlassian.net/browse/HHH-14148?atlOrigin=eyJpIjoiZWEyMWMzMWU3NDhmNGY1MThkZDhlZTNiOGU3NzA0ZjUiLCJwIjoiaiJ9 )
Change By: Amr Mostafa ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%3A4af3ec09-e6c6-4bc1-a4cc-7a112dc7970d )
I'm getting Hibernate generates an invalid SQL syntax error for the case below , that basically resembles this: `
{noformat} SELECT ... ORDER BY field nulls last nulls last ` {noformat}
(duplicate null precedence at the end)
The issue is constantly reproducible with a simple setup where you have 2 entities with a ` {{ @OneToMany ` }} relation with ` {{ @OrderBy ` }} annotation. Then at query time specify that relation in the entity graph hint.
I'm attaching the test scenario, it has 2 almost identical test cases:
1. With entity graph hint: Fails
2. Without entity graph hint: Succeeds
Please let me know if there is any other detail I could specify to help.
( https://hibernate.atlassian.net/browse/HHH-14148#add-comment?atlOrigin=eyJpIjoiZWEyMWMzMWU3NDhmNGY1MThkZDhlZTNiOGU3NzA0ZjUiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14148#add-comment?atlOrigin=eyJpIjoiZWEyMWMzMWU3NDhmNGY1MThkZDhlZTNiOGU3NzA0ZjUiLCJwIjoiaiJ9 )
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#100142- sha1:98e8dd4 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200811/40a0e0ad/attachment.html
More information about the hibernate-issues
mailing list