Package com.isomorphic.datasource
Enum Class SummaryFunctionType
- All Implemented Interfaces:
Serializable
,Comparable<SummaryFunctionType>
,Constable
Function to produce a summary value based on an array of records and a field definition. An example usage is the ListGrid.setShowGridSummary(), where a row is shown at the bottom of the listGrid containing summary information about each column.
SummaryFunctions may be specified in one of 2 ways:
- as an explicit function that takes 3 parameters:
-records
an array of records
-field
the field definition for which the summary is required - As an predefined
SummaryFunctionType
type.
-
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.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.Implemented as SQL CONCAT function when the underlying database product is Oracle, and with a separate database fetch on other database products, for 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
-
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
-