|
I've created a pull request [1]. If Hibernate has no information available about the parameter type when binding a null value, the pull request allows using the return value from javax.persistence.Parameter#getParameterType() when provided by javax.persistence.Query#setParameter(Parameter<T> param, T value),
According to Javadoc for javax.persistenceParameter#getParameterType:
"Applications that use this method for Java Persistence query language queries and native queries will not be portable."
Although not portable, it is helpful in this case when Hibernate has no information about the property type to use when binding a null value This is especially helpful when using Oracle, because Oracle throws an exception when a null is bound as BINARY (the default) that cannot be converted to the type for an intended column (e.g., a NUMBER column).
[1] https://github.com/hibernate/hibernate-orm/pull/1138
|