? heuristicType
: Number.class.isAssignableFrom( heuristicType.getReturnedClass() )
? heuristicType
: expectedType;
try {
LiteralType literalType = ( LiteralType ) type;
Dialect dialect = factory.getDialect();
return literalType.objectToSQLString( constantValue, dialect );
}
catch ( Exception t ) {
throw new QueryException( QueryTranslator.ERROR_CANNOT_FORMAT_LITERAL + constantExpression, t );
}
}