Hibernate SVN: r21165 - core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795/core/src/main/java/org/hibernate/type.
by hibernate-commits@lists.jboss.org
Author: gbadner
Date: 2014-08-22 00:38:01 -0400 (Fri, 22 Aug 2014)
New Revision: 21165
Modified:
core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795/core/src/main/java/org/hibernate/type/ComponentType.java
Log:
HHH-4459 : Query with Composite Primary Key parameter crashes when query cache is on
Modified: core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795/core/src/main/java/org/hibernate/type/ComponentType.java
===================================================================
--- core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795/core/src/main/java/org/hibernate/type/ComponentType.java 2014-08-22 00:17:51 UTC (rev 21164)
+++ core/patches/hibernate-3.3.2.GA_CP05_JBPAPP-10735_JBPAPP-10795/core/src/main/java/org/hibernate/type/ComponentType.java 2014-08-22 04:38:01 UTC (rev 21165)
@@ -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)