Erik Lumme (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMzQyNzEwZjAy...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14130?atlOrigin=eyJpIjoiMzQyNz...
) HHH-14130 (
https://hibernate.atlassian.net/browse/HHH-14130?atlOrigin=eyJpIjoiMzQyNz...
) When setting "hibernate.criteria.literal_handling_mode" to "BIND",
entities can't be compared to IDs in criteria queries (
https://hibernate.atlassian.net/browse/HHH-14130?atlOrigin=eyJpIjoiMzQyNz...
)
Change By: Erik Lumme (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Consider an entity with an ID of type Long. An entity can be found based on it's ID in
a criteria query using a construct such as this
{noformat}Root<TestEntity> root = cq.from(TestEntity.class);
cq.where(root.in(1, 2, 3));{noformat}
However, when setting {{hibernate.criteria.literal_handling_mode}} to {{BIND}}, this no
longer works, but results in the error:
{{java.lang.IllegalArgumentException: Parameter value [1] did not match expected type
[org.hibernate.bugs.TestEntity (n/a)]}}
Test case can be found on
[
GitHub|https://github.com/eriklumme/hibernate-bind-test/blob/master/src/t...].
The test case {{ hhhTest_works hhh14130_test_works }} passes, and {{ hhhTest_fails
hhh14130_test_fails }} fails.
(
https://hibernate.atlassian.net/browse/HHH-14130#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14130#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#100140- sha1:33445dc )