HHH-3383 - QueryKey is storing references to entities instead of identifiers

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@16660 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Steve Ebersole 2009-06-01 22:08:28 +00:00
parent baa2efd863
commit 77b959f5cc
1 changed files with 19 additions and 13 deletions

View File

@ -91,19 +91,25 @@ public class QueryKey implements Serializable {
}
// 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...