Author: gbadner
Date: 2014-08-26 19:55:48 -0400 (Tue, 26 Aug 2014)
New Revision: 21169
Modified:
core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795_v2/core/src/main/java/org/hibernate/type/ComponentType.java
Log:
HHH-4459 : Query with Composite Primary Key parameter crashes when query
Modified:
core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795_v2/core/src/main/java/org/hibernate/type/ComponentType.java
===================================================================
---
core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795_v2/core/src/main/java/org/hibernate/type/ComponentType.java 2014-08-26
23:20:23 UTC (rev 21168)
+++
core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795_v2/core/src/main/java/org/hibernate/type/ComponentType.java 2014-08-26
23:55:48 UTC (rev 21169)
@@ -373,7 +373,16 @@
public Object[] getPropertyValues(Object component, EntityMode entityMode)
throws HibernateException {
- return tuplizerMapping.getTuplizer( entityMode ).getPropertyValues( component );
+ if (component instanceof Object[]) {
+ // A few calls to hashCode pass the property values already in an
+ // Object[] (ex: QueryKey hash codes for cached queries).
+ // It's easiest to just check for the condition here prior to
+ // trying reflection.
+ return (Object[]) component;
+ } else {
+ return tuplizerMapping.getTuplizer(entityMode).getPropertyValues(
+ component);
+ }
}
public void setPropertyValues(Object component, Object[] values, EntityMode entityMode)
Show replies by date