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 projectedPropertyProjection
public static PropertyProjection groupProperty(String propertyName)
propertyName
- The name of the property to groupPropertyProjection
public static IdentifierProjection id()
IdentifierProjection
public static Projection distinct(Projection projection)
projection
- The project to treat distinctlyDistinct
public static ProjectionList projectionList()
public static Projection rowCount()
RowCountProjection
public static CountProjection count(String propertyName)
propertyName
- The name of the property to count overCountProjection
public static CountProjection countDistinct(String propertyName)
propertyName
- The name of the property to count overCountProjection
public static AggregateProjection max(String propertyName)
propertyName
- The property for which to find the maxAggregateProjection
public static AggregateProjection min(String propertyName)
propertyName
- The property for which to find the minAggregateProjection
public static AggregateProjection avg(String propertyName)
propertyName
- The property over which to find the averageAvgProjection
public static AggregateProjection sum(String propertyName)
propertyName
- The property over which to sumAggregateProjection
public static Projection alias(Projection projection, String alias)
projection
- The projection to be aliasedalias
- The alias to applyAliasedProjection
public static Projection sqlProjection(String sql, String[] columnAliases, Type[] types)
sql
- The SQL fragmentcolumnAliases
- The column aliasestypes
- The resulting typesSQLProjection
public 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 typesSQLProjection
Copyright © 2016 JBoss by Red Hat. All rights reserved.