Red Hat Bugzilla – Bug 1268468
[GSS](6.4.z) HHH-10161 - Hibernate ignores return value from javax.persistence.Parameter#getParameterType()
Last modified: 2017-01-17 06:49:30 EST
Pull request: https://github.com/hibernate/hibernate-orm/pull/1138
The pull request will use the value returned by javax.persistence.Parameter#getParameterType only when binding a null value, and only when Hibernate has no other way to determine the type (e.g., native queries).
NOTE: Javadoc for javax.persistence.Parameter#getParameterType says:
"This method is required to be supported for criteria queries only. Applications that use this method for Java Persistence query language queries and native queries will not be portable."
In other words, the fix in the pull request is not portable for native queries. I don't see any way to provide this information that is portable, so I've implemented a fix to deal with this particular situation.
This has been fixed in Hibernate ORM master and 5.0 branches, released in Hibernate ORM 5.0.4.
Verified in EAP 6.4.6.CR2
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.