Fix issue with BinaryArithmeticExpression type resolution
This commit is contained in:
parent
3e3db6d352
commit
b6ed4b6629
|
@ -1671,14 +1671,11 @@ public abstract class BaseSqmToSqlAstConverter
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
return new BinaryArithmeticExpression(
|
return new BinaryArithmeticExpression(
|
||||||
toSqlExpression( leftOperand.accept(this) ),
|
toSqlExpression( leftOperand.accept( this ) ),
|
||||||
expression.getOperator(),
|
expression.getOperator(),
|
||||||
toSqlExpression( rightOperand.accept(this) ),
|
toSqlExpression( rightOperand.accept( this ) ),
|
||||||
expression.getNodeType() instanceof BasicValuedMapping
|
getExpressionType( expression )
|
||||||
? (BasicValuedMapping) expression.getNodeType()
|
|
||||||
: (BasicValuedMapping) expression.getLeftHandOperand().getNodeType()
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
private Expression toSqlExpression(Object value) {
|
||||||
return (Expression) value;
|
return (Expression) value;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue