Author: steve.ebersole(a)jboss.com
Date: 2009-06-01 18:08:28 -0400 (Mon, 01 Jun 2009)
New Revision: 16660
Modified:
core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java
Log:
HHH-3383 - QueryKey is storing references to entities instead of identifiers
Modified: core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java
===================================================================
--- core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java 2009-06-01 21:50:17
UTC (rev 16659)
+++ core/trunk/core/src/main/java/org/hibernate/cache/QueryKey.java 2009-06-01 22:08:28
UTC (rev 16660)
@@ -91,20 +91,26 @@
}
// disassemble named parameters
- Map namedParameters = CollectionHelper.mapOfSize(
queryParameters.getNamedParameters().size() );
- Iterator itr = queryParameters.getNamedParameters().entrySet().iterator();
- while ( itr.hasNext() ) {
- final Map.Entry namedParameterEntry = ( Map.Entry ) itr.next();
- final TypedValue original = ( TypedValue ) namedParameterEntry.getValue();
- namedParameters.put(
- namedParameterEntry.getKey(),
- new TypedValue(
- original.getType(),
- original.getType().disassemble( original.getValue(), session, null ),
- session.getEntityMode()
- )
- );
+ final Map namedParameters;
+ if ( queryParameters.getNamedParameters() == null ) {
+ namedParameters = null;
}
+ else {
+ namedParameters = CollectionHelper.mapOfSize(
queryParameters.getNamedParameters().size() );
+ Iterator itr = queryParameters.getNamedParameters().entrySet().iterator();
+ while ( itr.hasNext() ) {
+ final Map.Entry namedParameterEntry = ( Map.Entry ) itr.next();
+ final TypedValue original = ( TypedValue ) namedParameterEntry.getValue();
+ namedParameters.put(
+ namedParameterEntry.getKey(),
+ new TypedValue(
+ original.getType(),
+ original.getType().disassemble( original.getValue(), session, null ),
+ session.getEntityMode()
+ )
+ );
+ }
+ }
// decode row selection...
final RowSelection selection = queryParameters.getRowSelection();
Show replies by date