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)
SumFunction
| Access | Constructor and Description |
|---|---|
| public | SumFunctionStateObject(StateObject
The parent of this state object, which cannot be parent)nullCreates a new |
| public | SumFunctionStateObject(StateObject
The parent of this state object, which cannot be parent, boolean nulltrue to add DISTINCT to the query in order to
have distinct values; false if it is not requiredThe stateObject)StateObject representing the encapsulated expressionCreates a new |
| public | SumFunctionStateObject(StateObject
The parent of this state object, which cannot be parent, boolean nulltrue to add DISTINCT to the query in order to
have distinct values; false if it is not requiredEither the identification variable or the state field path expression path)Creates a new |
| public | SumFunctionStateObject(StateObject
The parent of this state object, which cannot be parent, StateObject nullThe stateObject)StateObject representing the encapsulated expressionCreates a new |
| public | SumFunctionStateObject(StateObject
The parent of this state object, which cannot be parent, String nullEither the identification variable or the state field path expression path)Creates a new |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(StateObjectVisitor
The visitor)visitor to visit this objectImplements org. StateObject by the given visitor.
|
| public SumFunction | getExpression()
Overrides org. Implements org. StateObject representation of the JPQL query
was created by parsing an existing JPQL query.
|
| public String | getIdentifier()
Implements abstract org. AbstractSingleEncapsulatedExpressionStateObject.
|
| protected String | getQueryBNFId()
Implements abstract org. JPQLQueryBNF that will determine how to parse the encapsulated expression.
|
| public void | setExpression(SumFunction
The expression)parsed object representing a SUM
expressionKeeps a reference of the |
| SumFunctionStateObject | back to summary |
|---|---|
| public SumFunctionStateObject(StateObject parent) Creates a new
| |
| SumFunctionStateObject | back to summary |
|---|---|
| public SumFunctionStateObject(StateObject parent, boolean distinct, StateObject stateObject) Creates a new
| |
| SumFunctionStateObject | back to summary |
|---|---|
| public SumFunctionStateObject(StateObject parent, boolean distinct, String path) Creates a new
| |
| SumFunctionStateObject | back to summary |
|---|---|
| public SumFunctionStateObject(StateObject parent, StateObject stateObject) Creates a new
| |
| SumFunctionStateObject | back to summary |
|---|---|
| public SumFunctionStateObject(StateObject parent, String path) Creates a new
| |
| accept | back to summary |
|---|---|
| public void accept(StateObjectVisitor visitor) Implements org. Doc from org. Visits this
| |
| getExpression | back to summary |
|---|---|
| public SumFunction getExpression() Overrides org. Implements org. Doc from org. Returns the actual parsed object if this
| |
| getIdentifier | back to summary |
|---|---|
| public String getIdentifier() Implements abstract org. Returns the JPQL identifier of the expression represented by this | |
| getQueryBNFId | back to summary |
|---|---|
| protected String getQueryBNFId() Implements abstract org. Returns the unique identifier of the | |
| setExpression | back to summary |
|---|---|
| public void setExpression(SumFunction expression) Keeps a reference of the
| |