[hibernate-issues] [JIRA] (HHH-14121) Params from main orderBy query are trying to be inserted to subselect query ->parameter index out of range
Raman Kreidzich (JIRA)
jira at hibernate.atlassian.net
Mon Jul 27 16:03:06 EDT 2020
Raman Kreidzich ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5cbe15fe2675f70e50cd54f5 ) *updated* an issue
Hibernate ORM ( https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNTEwNmNkYjAwNGRhNDI2NDgwNzM4YjY4ZTFiNTdiM2UiLCJwIjoiaiJ9 ) / Bug ( https://hibernate.atlassian.net/browse/HHH-14121?atlOrigin=eyJpIjoiNTEwNmNkYjAwNGRhNDI2NDgwNzM4YjY4ZTFiNTdiM2UiLCJwIjoiaiJ9 ) HHH-14121 ( https://hibernate.atlassian.net/browse/HHH-14121?atlOrigin=eyJpIjoiNTEwNmNkYjAwNGRhNDI2NDgwNzM4YjY4ZTFiNTdiM2UiLCJwIjoiaiJ9 ) Params from main orderBy query are trying to be inserted to subselect query ->parameter index out of range ( https://hibernate.atlassian.net/browse/HHH-14121?atlOrigin=eyJpIjoiNTEwNmNkYjAwNGRhNDI2NDgwNzM4YjY4ZTFiNTdiM2UiLCJwIjoiaiJ9 )
Change By: Raman Kreidzich ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5cbe15fe2675f70e50cd54f5 )
There are two entities: Post and Comment.
Post has collection of comments that are selected in subselect query:
{{@OneToMany(mappedBy = "post", fetch = FetchType.EAGER, cascade = CascadeType.MERGE)}}
{{@Fetch(value = FetchMode.SUBSELECT)}}
{{private List<Comment> comments;}}
When Post entities are selected by CriteriaQuery with specific 'orderBy' expression that contains params (see fragment below), exception '_SQLException: Parameter index out of range (1 > number of parameters, which is 0)._' is thrown.
{{Order order = builder.desc(builder.coalesce(root.get("name"), "default_name"));}}
{{query.orderBy(order);}}
ORMUnitTestCase: [https://github.com/ hibernate Plutonii /hibernate-test-case-templates/ pull commit / 35 fffdf624ba2bec5ca4db84c27ba942f0aa30ac3c |https://github.com/ hibernate Plutonii /hibernate-test-case-templates/ pull commit / 35 fffdf624ba2bec5ca4db84c27ba942f0aa30ac3c|smart-link ]
( https://hibernate.atlassian.net/browse/HHH-14121#add-comment?atlOrigin=eyJpIjoiNTEwNmNkYjAwNGRhNDI2NDgwNzM4YjY4ZTFiNTdiM2UiLCJwIjoiaiJ9 ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-14121#add-comment?atlOrigin=eyJpIjoiNTEwNmNkYjAwNGRhNDI2NDgwNzM4YjY4ZTFiNTdiM2UiLCJwIjoiaiJ9 )
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:fbb0377 )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20200727/8cacb1c2/attachment.html
More information about the hibernate-issues
mailing list