public final class Projections extends Object
Restrictions factory methods for generating Criterion instancesCriteria| Modifier and Type | Method and Description | 
|---|---|
static Projection | 
alias(Projection projection,
     String alias)
Assign an alias to a projection, by wrapping it 
 | 
static AggregateProjection | 
avg(String propertyName)
A property average value projection 
 | 
static CountProjection | 
count(String propertyName)
A property value count projection 
 | 
static CountProjection | 
countDistinct(String propertyName)
A distinct property value count projection 
 | 
static Projection | 
distinct(Projection projection)
Create a distinct projection from a projection. 
 | 
static PropertyProjection | 
groupProperty(String propertyName)
A grouping property value projection 
 | 
static IdentifierProjection | 
id()
An identifier value projection. 
 | 
static AggregateProjection | 
max(String propertyName)
A property maximum value projection 
 | 
static AggregateProjection | 
min(String propertyName)
A property minimum value projection 
 | 
static ProjectionList | 
projectionList()
Create a new projection list. 
 | 
static PropertyProjection | 
property(String propertyName)
A property value projection 
 | 
static Projection | 
rowCount()
The query row count, ie. 
 | 
static Projection | 
sqlGroupProjection(String sql,
                  String groupBy,
                  String[] columnAliases,
                  Type[] types)
A grouping SQL projection, specifying both select clause and group by clause fragments 
 | 
static Projection | 
sqlProjection(String sql,
             String[] columnAliases,
             Type[] types)
A SQL projection, a typed select clause fragment 
 | 
static AggregateProjection | 
sum(String propertyName)
A property value sum projection 
 | 
public static PropertyProjection property(String propertyName)
propertyName - The name of the property whose values should be projectedPropertyProjectionpublic static PropertyProjection groupProperty(String propertyName)
propertyName - The name of the property to groupPropertyProjectionpublic static IdentifierProjection id()
IdentifierProjectionpublic static Projection distinct(Projection projection)
projection - The project to treat distinctlyDistinctpublic static ProjectionList projectionList()
public static Projection rowCount()
RowCountProjectionpublic static CountProjection count(String propertyName)
propertyName - The name of the property to count overCountProjectionpublic static CountProjection countDistinct(String propertyName)
propertyName - The name of the property to count overCountProjectionpublic static AggregateProjection max(String propertyName)
propertyName - The property for which to find the maxAggregateProjectionpublic static AggregateProjection min(String propertyName)
propertyName - The property for which to find the minAggregateProjectionpublic static AggregateProjection avg(String propertyName)
propertyName - The property over which to find the averageAvgProjectionpublic static AggregateProjection sum(String propertyName)
propertyName - The property over which to sumAggregateProjectionpublic static Projection alias(Projection projection, String alias)
projection - The projection to be aliasedalias - The alias to applyAliasedProjectionpublic static Projection sqlProjection(String sql, String[] columnAliases, Type[] types)
sql - The SQL fragmentcolumnAliases - The column aliasestypes - The resulting typesSQLProjectionpublic static Projection sqlGroupProjection(String sql, String groupBy, String[] columnAliases, Type[] types)
sql - The SQL SELECT fragmentgroupBy - The SQL GROUP BY fragmentcolumnAliases - The column aliasestypes - The resulting typesSQLProjectionCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.