Disable Query parameter validation when a Session is unwrapped from an EntityManager

Description

The "Query parameter binding validation" introduced in HHH-11397 (commit 55af30e) is too strict when using a org.hibernate.usertype.UserType.

The query parameter value is always compared with the return value of the UserType's returnedClass() method.

In our UserType's nullSafeSet method, we accept instances of the UserType's returnedClass() method as value, as well as other values (which worked in Hibernate 5.2.8 and leads to an IllegalArgumentException in Hibernate 5.2.9).

Test case: see

.

Environment

None

Status

Assignee

Andrea Boriero

Reporter

Alfred Staflinger

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.2.8

Components

Affects versions

Priority

Major
Configure