use of org.eclipse.persistence.jpa.jpql.parser.DivisionExpression in project eclipselink by eclipse-ee4j.
the class ReportItemBuilder method visit.
@Override
public void visit(DivisionExpression expression) {
Expression queryExpression = queryContext.buildExpression(expression, type);
if (type[0] == Object.class) {
type[0] = null;
}
addAttribute("divide", queryExpression, type[0]);
}
use of org.eclipse.persistence.jpa.jpql.parser.DivisionExpression in project eclipselink by eclipse-ee4j.
the class ExpressionBuilderVisitor method visit.
@Override
public void visit(DivisionExpression expression) {
List<Class<?>> types = new ArrayList<>(2);
// Create the left side of the division expression
expression.getLeftExpression().accept(this);
Expression leftExpression = queryExpression;
types.add(type[0]);
// Create the right side of the division expression
expression.getRightExpression().accept(this);
Expression rightExpression = queryExpression;
types.add(type[0]);
// Now create the division expression
queryExpression = ExpressionMath.divide(leftExpression, rightExpression);
// Set the expression type
Collections.sort(types, NumericTypeComparator.instance());
type[0] = types.get(0);
}
Aggregations