Erik Lumme (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiY2Y1Y2I2MzZl...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14130?atlOrigin=eyJpIjoiY2Y1Y2...
) HHH-14130 (
https://hibernate.atlassian.net/browse/HHH-14130?atlOrigin=eyJpIjoiY2Y1Y2...
) 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=eyJpIjoiY2Y1Y2...
)
Issue Type: Bug Affects Versions: 5.4.18 Assignee: Unassigned Components: hibernate-core
Created: 31/Jul/2020 00:25 AM Priority: Minor Reporter: 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
{{Root<TestEntity> root = cq.from(TestEntity.class);
cq.where(root.in(1, 2, 3));}}
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/test/jav...
). The test case hhhTest_works passes, and hhhTest_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 )