Fix issue with BinaryArithmeticExpression type resolution
This commit is contained in:
parent
3e3db6d352
commit
b6ed4b6629
|
@ -1671,14 +1671,11 @@ public abstract class BaseSqmToSqlAstConverter
|
|||
);
|
||||
}
|
||||
else {
|
||||
|
||||
return new BinaryArithmeticExpression(
|
||||
toSqlExpression( leftOperand.accept(this) ),
|
||||
toSqlExpression( leftOperand.accept( this ) ),
|
||||
expression.getOperator(),
|
||||
toSqlExpression( rightOperand.accept(this) ),
|
||||
expression.getNodeType() instanceof BasicValuedMapping
|
||||
? (BasicValuedMapping) expression.getNodeType()
|
||||
: (BasicValuedMapping) expression.getLeftHandOperand().getNodeType()
|
||||
toSqlExpression( rightOperand.accept( this ) ),
|
||||
getExpressionType( expression )
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1687,6 +1684,16 @@ public abstract class BaseSqmToSqlAstConverter
|
|||
}
|
||||
}
|
||||
|
||||
private BasicValuedMapping getExpressionType(SqmBinaryArithmetic expression) {
|
||||
SqmExpressable leftHandOperandType = expression.getLeftHandOperand().getNodeType();
|
||||
if ( leftHandOperandType instanceof BasicValuedMapping ) {
|
||||
return (BasicValuedMapping) leftHandOperandType;
|
||||
}
|
||||
else {
|
||||
return (BasicValuedMapping) expression.getRightHandOperand().getNodeType();
|
||||
}
|
||||
}
|
||||
|
||||
private Expression toSqlExpression(Object value) {
|
||||
return (Expression) value;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue