HHH-10796 - Fix org.hibernate.query.Query<R> setProperties(Map map); set to null parameters not contained in the map

(cherry picked from commit 35cefeda2f)

Conflicts:
	hibernate-core/src/main/java/org/hibernate/query/internal/AbstractProducedQuery.java

(cherry picked from commit dc32226aab)
This commit is contained in:
Andrea Boriero 2016-06-03 12:33:38 +01:00 committed by Gail Badner
parent 5be28c85a0
commit 358bed04ac
1 changed files with 6 additions and 4 deletions

View File

@ -900,11 +900,13 @@ public abstract class AbstractQueryImpl implements Query {
String namedParam = params[i];
final Object object = map.get( namedParam );
if ( object == null ) {
Type type = parameterMetadata.getNamedParameterDescriptor( namedParam ).getExpectedType();
if ( type == null ) {
type = StandardBasicTypes.SERIALIZABLE;
if ( map.containsKey( namedParam ) ) {
Type type = parameterMetadata.getNamedParameterDescriptor( namedParam ).getExpectedType();
if ( type == null ) {
type = StandardBasicTypes.SERIALIZABLE;
}
setParameter( namedParam, null, type );
}
setParameter( namedParam, object, type );
}
else {
Class retType = object.getClass();