Enum Class SummaryFunctionType
- All Implemented Interfaces:
Serializable,Comparable<SummaryFunctionType>,Constable
SummaryFunctions may be specified in one of 2 ways:
- as an explicit function that takes 3 parameters:
-recordsan array of records
-fieldthe field definition for which the summary is required - As an predefined
SummaryFunctionTypetype.
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionReturns a list of the values of the summary field in all matching records.Iterates through the set of records, picking up all numeric values for the specified field and determining the mean value.Returns a string concatenation of the values of the summary field in all matching records.LikeCONCAT, but removes duplicate values before concatenation.Returns a numeric count of the total number of records passed in.Currently behaves the same way asMIN.Iterates through the set of records, picking up all values for the specified field and finding the maximum value.Iterates through the set of records, picking up all values for the specified field and finding the minimum value.Iterates through the set of records, picking up and summing all numeric values for the specified field.
-
Enum Constant Details
-
FIRST
Currently behaves the same way asMIN. -
SUM
Iterates through the set of records, picking up and summing all numeric values for the specified field. Returns null to indicate invalid summary value if any non numeric field values are encountered. -
AVG
Iterates through the set of records, picking up all numeric values for the specified field and determining the mean value. Returns null to indicate invalid summary value if any non numeric field values are encountered. -
MAX
Iterates through the set of records, picking up all values for the specified field and finding the maximum value. Handles numeric fields and date type fields only. Returns null to indicate invalid summary value if any non numeric/date field values are encountered. -
MIN
Iterates through the set of records, picking up all values for the specified field and finding the minimum value. Handles numeric fields and date type fields only. Returns null to indicate invalid summary value if any non numeric field values are encountered. -
COUNT
Returns a numeric count of the total number of records passed in. -
CONCAT
Returns a string concatenation of the values of the summary field in all matching records.Natively supported on Oracle (LISTAGG), PostgreSQL (string_agg), and MySQL (GROUP_CONCAT). On other databases, implemented with a separate concatFetch query. Also supported client-side for clientOnly and cached DataSources.
-
CONCAT_DISTINCT
LikeCONCAT, but removes duplicate values before concatenation.Natively supported on Oracle 19c+ (LISTAGG DISTINCT), PostgreSQL 9.0+ (string_agg DISTINCT), and MySQL (GROUP_CONCAT DISTINCT). On other databases and for the Java concatFetch fallback, deduplication is applied programmatically after fetching values. Also supported client-side for clientOnly and cached DataSources.
-
ARRAY
Returns a list of the values of the summary field in all matching records.Implemented with a separate database fetch with SQLDataSource. Also supported as a post-process function on generic DataSource implementations that do not inherently support aggregation. Not supported by the Hibernate and JPA DataSources
-