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.