Package net.pricefx.service
Class ItemSummaryQuery.Projection
Object
Projection
- Enclosing class:
ItemSummaryQuery<T extends PersistedObject & HasCalculableObjectItems>
One aggregated field of the summary query. Add projections with
ItemSummaryQuery.addProjection(String, String) and its overloads rather than creating
instances of this class.-
Constructor Summary
ConstructorsConstructorDescriptionInternal: used by the server to read saved queries.Projection(String distinctName, String fieldName, String aggregationMode, String weight) Internal: used by the server.Projection(String distinctName, String fieldNamePrefix, String fieldName, String aggregationMode, String weight) Internal: used by the server. -
Method Summary
Modifier and TypeMethodDescriptionReturns the aggregation of this projection.Returns the key under which the result rows ofPublicGroovyAPI.runSummaryQuery(ItemSummaryQuery)hold the value of this projection.Internal: used in SQL queries, overcomes ORACLE 32byte length identifier limit.Returns the name or label of the aggregated item field, as it was passed toItemSummaryQuery.addProjection(String, String).Returns the attribute-extension prefix of the aggregated field.Returns the name or label of the field that weights the aggregated values.
-
Constructor Details
-
Projection
public Projection()Internal: used by the server to read saved queries. Not for use in logic. -
Projection
Internal: used by the server. Not for use in logic. UseItemSummaryQuery.addProjection(String, String, String)instead.- Parameters:
distinctName- the identifier of the projection in the database queryfieldName- the name or label of the aggregated item fieldaggregationMode- the aggregation:"SUM","AVG","MIN"or"MAX"weight- the name or label of the weight field, ornull
-
Projection
public Projection(String distinctName, String fieldNamePrefix, String fieldName, String aggregationMode, String weight) Internal: used by the server. Not for use in logic. UseItemSummaryQuery.addProjection(String, String, String, String)instead.- Parameters:
distinctName- the identifier of the projection in the database queryfieldNamePrefix- the attribute-extension prefix, or an empty stringfieldName- the name or label of the aggregated item fieldaggregationMode- the aggregation:"SUM","AVG","MIN"or"MAX"weight- the name or label of the weight field, ornull
-
-
Method Details
-
getFieldNamePrefix
Returns the attribute-extension prefix of the aggregated field.- Returns:
- the prefix passed to
ItemSummaryQuery.addProjection(String, String, String, String), withattributeExtension___added in front of it (for exampleattributeExtension___oldVal_for the prefixoldVal_), or an empty string for a regular item field
-
getFieldName
Returns the name or label of the aggregated item field, as it was passed toItemSummaryQuery.addProjection(String, String).- Returns:
- the field name or label
-
getAggregationMode
Returns the aggregation of this projection.- Returns:
"SUM","AVG","MIN"or"MAX"
-
getWeight
Returns the name or label of the field that weights the aggregated values.- Returns:
- the weight field, or
nullwhen the projection is not weighted
-
getDistinctName
Internal: used in SQL queries, overcomes ORACLE 32byte length identifier limit. Not for use in logic.- Returns:
- the short identifier of the projection in the database query, for example
dn_0
-
getClientSideDistinctName
Returns the key under which the result rows ofPublicGroovyAPI.runSummaryQuery(ItemSummaryQuery)hold the value of this projection. It is the lower-case form of<prefix><aggregation>_<field>_<weight>.attributeExtension___is removed from the prefix, the field and the weight, spaces are removed, and%and*are replaced with_x_. For example, the prefixoldVal_gives a key that starts witholdval_.Example:
def query = api.getSimulationSummaryQuery() query.addProjection("resultPrice", "SUM") def key = query.getProjections()[0].getClientSideDistinctName() // key is "sum_resultprice_"- Returns:
- the key of this projection in the result rows
-