HHH-7705 - Fix Query.setProperties(Map) silently ignores null values provided in the Map

This commit is contained in:
Andrea Boriero 2016-02-01 18:24:46 +00:00
parent 5711c3ce6c
commit 7dec9f83e2
1 changed files with 15 additions and 11 deletions

View File

@ -900,8 +900,13 @@ public abstract class AbstractQueryImpl implements Query {
String namedParam = params[i];
final Object object = map.get( namedParam );
if ( object == null ) {
continue;
Type type = parameterMetadata.getNamedParameterDescriptor( namedParam ).getExpectedType();
if ( type == null ) {
type = StandardBasicTypes.SERIALIZABLE;
}
setParameter( namedParam, object, type );
}
else {
Class retType = object.getClass();
if ( Collection.class.isAssignableFrom( retType ) ) {
setParameterList( namedParam, (Collection) object );
@ -912,8 +917,7 @@ public abstract class AbstractQueryImpl implements Query {
else {
setParameter( namedParam, object, determineType( namedParam, retType ) );
}
}
}
return this;
}