Some misunderstanding happened in the parent task.
Reporter wrote in description that exception happens in {code:java} org.hibernate.persister.entity.DiscriminatorType.nullSafeSet(PreparedStatement, Object, int, SessionImplementor) {code} 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.: {code:SQL} SELECT p FROM Person p WHERE (:personType IS NULL OR TYPE(p) = :personType) {code}
So the test case attached to the parent task is incorrect, *see the attached modified test case [^HHH-8387.zip] to verify*.
Exception happens because of this row in the _org.hibernate.persister.entity.DiscriminatorType.nullSafeSet(PreparedStatement, Object, int, SessionImplementor) method_: {code:java} String entityName = session.getFactory().getClassMetadata((Class) value).getEntityName(); {code} When _value_ is _null_ _getClassMetadata()_ throws _NullPointerException_. |
|