Cannot set null value for TYPE() parameter binding

Description

Some misunderstanding happened in the parent task.

Reporter wrote in description that exception happens in

method, but it called only when binding parameter to TYPE() expression.

I have the same issue when trying to write a query with optional parameters, e.g.:

So the test case attached to the parent task is incorrect, see the attached modified test case

to verify.

Exception happens because of this row in the org.hibernate.persister.entity.DiscriminatorType.nullSafeSet(PreparedStatement, Object, int, SessionImplementor) method:

When value is null getClassMetadata() throws NullPointerException.

Environment

None

Assignee

Unassigned

Reporter

Andrii Mozharovskyi

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

Major
Configure