One of the aggregate functions. The arguments must be numeric.
SUM returns Long when applied to state-fields of integral types (other than BigInteger); Double when applied to state-fields of floating point types; BigInteger when applied to state-fields of type BigInteger; and BigDecimal when applied to state-fields of type BigDecimal. If SUM, AVG, MAX, or MIN is used, and there are no values to which the aggregate function can be applied, the result of the aggregate function is null. If COUNT is used, and there are no values to which COUNT can be applied, the result of the aggregate function is 0.
BNF: expression ::= SUM([DISTINCT] state_field_path_expression)
@see SumFunction
@version 2.4
@since 2.4
@author Pascal Filion
| add(stateObject);
return (T) this;
}
protected void sum(boolean distinct, String path) {
StateObject stateObject = new SumFunctionStateObject(parent, distinct, literal(path));
add(stateObject);
}
|
| @Override
public void visit(SumFunction expression) {
expression.getExpression().accept(this);
SumFunctionStateObject stateObject = new SumFunctionStateObject(
parent,
expression.hasDistinct(),
this.stateObject
);
stateObject.setExpression(expression);
this.stateObject = stateObject;
}
|
Related Classes of org.eclipse.persistence.jpa.jpql.tools.model.query.SumFunctionStateObject
Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact
coftware#gmail.com.