HHH-18564 Handle attribute converters for query literals
Allow both domain and relational forms when an attribute converter is present
This commit is contained in:
parent
d1980cba14
commit
9886b7acf9
|
@ -7425,12 +7425,13 @@ public abstract class BaseSqmToSqlAstConverter<T extends Statement> extends Base
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings({"unchecked", "rawtypes"})
|
||||||
@Override
|
@Override
|
||||||
public Object visitFieldLiteral(SqmFieldLiteral<?> sqmFieldLiteral) {
|
public Object visitFieldLiteral(SqmFieldLiteral<?> sqmFieldLiteral) {
|
||||||
return new QueryLiteral<>(
|
final BasicValuedMapping valueMapping = (BasicValuedMapping) determineValueMapping( sqmFieldLiteral );
|
||||||
sqmFieldLiteral.getValue(),
|
final Object value = sqmFieldLiteral.getValue();
|
||||||
(BasicValuedMapping) determineValueMapping( sqmFieldLiteral )
|
final BasicValueConverter converter = valueMapping.getJdbcMapping().getValueConverter();
|
||||||
);
|
return new QueryLiteral<>( converter != null ? sqlLiteralValue( converter, value ) : value, valueMapping );
|
||||||
}
|
}
|
||||||
|
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
Loading…
Reference in New Issue