diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/MappingMetamodelImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/MappingMetamodelImpl.java index 2988762c9c..a96a2ef7a1 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/MappingMetamodelImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/model/domain/internal/MappingMetamodelImpl.java @@ -775,12 +775,11 @@ public class MappingMetamodelImpl extends QueryParameterBindingTypeResolverImpl } if ( sqmExpressible instanceof BasicDomainType ) { - final BasicDomainType domainType = (BasicDomainType) sqmExpressible; - return getTypeConfiguration().getBasicTypeForJavaType( domainType.getExpressibleJavaType().getJavaTypeClass() ); + return getTypeConfiguration().getBasicTypeForJavaType( sqmExpressible.getRelationalJavaType().getJavaType() ); } if ( sqmExpressible instanceof BasicSqmPathSource ) { - return getTypeConfiguration().getBasicTypeForJavaType(((BasicSqmPathSource) sqmExpressible).getJavaType()); + return getTypeConfiguration().getBasicTypeForJavaType( sqmExpressible.getRelationalJavaType().getJavaType() ); } if ( sqmExpressible instanceof SqmFieldLiteral ) {