HHH-16803 Specially handle enum classes in nullLiteral
This commit is contained in:
parent
9f1239ce77
commit
96c4b98039
|
@ -1294,8 +1294,12 @@ public class SqmCriteriaNodeBuilder implements NodeBuilder, SqmCreationContext,
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public <T> SqmExpression<T> nullLiteral(Class<T> resultClass) {
|
public <T> SqmExpression<T> nullLiteral(Class<T> resultClass) {
|
||||||
final TypeConfiguration typeConfiguration = getTypeConfiguration();
|
if ( resultClass.isEnum() ) {
|
||||||
final BasicType<T> basicTypeForJavaType = typeConfiguration.getBasicTypeForJavaType( resultClass );
|
// No basic types are registered for enum java types, we have to use an untyped null literal in this case
|
||||||
|
return new SqmLiteralNull<>( this );
|
||||||
|
}
|
||||||
|
final BasicType<T> basicTypeForJavaType = getTypeConfiguration().getBasicTypeForJavaType( resultClass );
|
||||||
|
// if there's no basic type, it might be an entity type
|
||||||
final SqmExpressible<T> sqmExpressible = basicTypeForJavaType == null
|
final SqmExpressible<T> sqmExpressible = basicTypeForJavaType == null
|
||||||
? getDomainModel().managedType( resultClass )
|
? getDomainModel().managedType( resultClass )
|
||||||
: basicTypeForJavaType;
|
: basicTypeForJavaType;
|
||||||
|
|
Loading…
Reference in New Issue