Bug 1268468

Summary: [GSS](6.4.z) HHH-10161 - Hibernate ignores return value from javax.persistence.Parameter#getParameterType()
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Ricardo Martinelli de Oliveira <rmartine>
Component: HibernateAssignee: Gail Badner <gbadner>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Simka <msimka>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbaranow, bmaxwell, cdewolf, gbadner, istudens, jmartisk, msimka, rmartine, rsvoboda, smarlow
Target Milestone: CR1   
Target Release: EAP 6.4.6   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1225631 Environment:
Last Closed: 2017-01-17 11:49:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1225631    
Bug Blocks: 1235746, 1286824    

Comment 3 Gail Badner 2015-11-09 19:08:35 UTC
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.

Comment 5 Gail Badner 2015-11-30 17:53:53 UTC
This has been fixed in Hibernate ORM master and 5.0 branches, released in Hibernate ORM 5.0.4.

Comment 12 Jan Martiska 2016-01-19 13:22:26 UTC
Verified in EAP 6.4.6.CR2

Comment 13 Petr Penicka 2017-01-17 11:49:30 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.