When setting "hibernate.criteria.literal_handling_mode" to "BIND", entities can't be compared to IDs in criteria queries

Description

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

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 hhh14130_test_works passes, and hhh14130_test_fails fails.

Environment

None

Assignee

Unassigned

Reporter

Erik Lumme

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Minor
Configure