HHH-15716 ClassCastException in QueryParameterBindingsImpl.generateQueryKeyMemento
This commit is contained in:
parent
03f1ce9c49
commit
4ca9c2bb3b
|
@ -21,6 +21,7 @@ import org.hibernate.QueryParameterException;
|
||||||
import org.hibernate.cache.spi.QueryKey;
|
import org.hibernate.cache.spi.QueryKey;
|
||||||
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
import org.hibernate.engine.spi.SessionFactoryImplementor;
|
||||||
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
import org.hibernate.engine.spi.SharedSessionContractImplementor;
|
||||||
|
import org.hibernate.metamodel.mapping.EntityMappingType;
|
||||||
import org.hibernate.metamodel.mapping.MappingModelExpressible;
|
import org.hibernate.metamodel.mapping.MappingModelExpressible;
|
||||||
import org.hibernate.query.QueryParameter;
|
import org.hibernate.query.QueryParameter;
|
||||||
import org.hibernate.query.spi.ParameterMetadataImplementor;
|
import org.hibernate.query.spi.ParameterMetadataImplementor;
|
||||||
|
@ -214,8 +215,12 @@ public class QueryParameterBindingsImpl implements QueryParameterBindings {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( binding.getType() != null ) {
|
final MappingModelExpressible<?> type = binding.getType();
|
||||||
return binding.getType();
|
if ( type != null ) {
|
||||||
|
if ( type instanceof EntityMappingType ) {
|
||||||
|
return ( (EntityMappingType) type ).getIdentifierMapping();
|
||||||
|
}
|
||||||
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
final TypeConfiguration typeConfiguration = session.getFactory().getTypeConfiguration();
|
final TypeConfiguration typeConfiguration = session.getFactory().getTypeConfiguration();
|
||||||
|
|
Loading…
Reference in New Issue