All Implemented Interfaces:
StateObject

public class SumFunctionStateObject extends AggregateFunctionStateObject
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)

Since:
2.4
Version:
2.4
See Also:
  • Constructor Details

    • SumFunctionStateObject

      public SumFunctionStateObject(StateObject parent)
      Creates a new SumFunctionStateObject.
      Parameters:
      parent - The parent of this state object, which cannot be null
      Throws:
      NullPointerException - The given parent cannot be null
    • SumFunctionStateObject

      public SumFunctionStateObject(StateObject parent, boolean distinct, StateObject stateObject)
      Creates a new SumFunctionStateObject.
      Parameters:
      parent - The parent of this state object, which cannot be null
      distinct - true to add DISTINCT to the query in order to have distinct values; false if it is not required
      stateObject - The StateObject representing the encapsulated expression
      Throws:
      NullPointerException - The given parent cannot be null
    • SumFunctionStateObject

      public SumFunctionStateObject(StateObject parent, boolean distinct, String path)
      Creates a new SumFunctionStateObject.
      Parameters:
      parent - The parent of this state object, which cannot be null
      distinct - true to add DISTINCT to the query in order to have distinct values; false if it is not required
      path - Either the identification variable or the state field path expression
      Throws:
      NullPointerException - The given parent cannot be null
    • SumFunctionStateObject

      public SumFunctionStateObject(StateObject parent, StateObject stateObject)
      Creates a new SumFunctionStateObject.
      Parameters:
      parent - The parent of this state object, which cannot be null
      stateObject - The StateObject representing the encapsulated expression
      Throws:
      NullPointerException - The given parent cannot be null
    • SumFunctionStateObject

      public SumFunctionStateObject(StateObject parent, String path)
      Creates a new SumFunctionStateObject.
      Parameters:
      parent - The parent of this state object, which cannot be null
      path - Either the identification variable or the state field path expression
      Throws:
      NullPointerException - The given parent cannot be null
  • Method Details