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. The test case hhhTest_works passes, and hhhTest_fails fails. |