public final class Projections
extends java.lang.Object
Restrictions
factory methods for generating Criterion
instancesCriteria
Modifier and Type | Method and Description |
---|---|
static Projection |
alias(Projection projection,
java.lang.String alias)
Assign an alias to a projection, by wrapping it
|
static AggregateProjection |
avg(java.lang.String propertyName)
A property average value projection
|
static CountProjection |
count(java.lang.String propertyName)
A property value count projection
|
static CountProjection |
countDistinct(java.lang.String propertyName)
A distinct property value count projection
|
static Projection |
distinct(Projection projection)
Create a distinct projection from a projection.
|
static PropertyProjection |
groupProperty(java.lang.String propertyName)
A grouping property value projection
|
static IdentifierProjection |
id()
An identifier value projection.
|
static AggregateProjection |
max(java.lang.String propertyName)
A property maximum value projection
|
static AggregateProjection |
min(java.lang.String propertyName)
A property minimum value projection
|
static ProjectionList |
projectionList()
Create a new projection list.
|
static PropertyProjection |
property(java.lang.String propertyName)
A property value projection
|
static Projection |
rowCount()
The query row count, ie.
|
static Projection |
sqlGroupProjection(java.lang.String sql,
java.lang.String groupBy,
java.lang.String[] columnAliases,
Type[] types)
A grouping SQL projection, specifying both select clause and group by clause fragments
|
static Projection |
sqlProjection(java.lang.String sql,
java.lang.String[] columnAliases,
Type[] types)
A SQL projection, a typed select clause fragment
|
static AggregateProjection |
sum(java.lang.String propertyName)
A property value sum projection
|
public static PropertyProjection property(java.lang.String propertyName)
propertyName
- The name of the property whose values should be projectedPropertyProjection
public static PropertyProjection groupProperty(java.lang.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(java.lang.String propertyName)
propertyName
- The name of the property to count overCountProjection
public static CountProjection countDistinct(java.lang.String propertyName)
propertyName
- The name of the property to count overCountProjection
public static AggregateProjection max(java.lang.String propertyName)
propertyName
- The property for which to find the maxAggregateProjection
public static AggregateProjection min(java.lang.String propertyName)
propertyName
- The property for which to find the minAggregateProjection
public static AggregateProjection avg(java.lang.String propertyName)
propertyName
- The property over which to find the averageAvgProjection
public static AggregateProjection sum(java.lang.String propertyName)
propertyName
- The property over which to sumAggregateProjection
public static Projection alias(Projection projection, java.lang.String alias)
projection
- The projection to be aliasedalias
- The alias to applyAliasedProjection
public static Projection sqlProjection(java.lang.String sql, java.lang.String[] columnAliases, Type[] types)
sql
- The SQL fragmentcolumnAliases
- The column aliasestypes
- The resulting typesSQLProjection
public static Projection sqlGroupProjection(java.lang.String sql, java.lang.String groupBy, java.lang.String[] columnAliases, Type[] types)
sql
- The SQL SELECT fragmentgroupBy
- The SQL GROUP BY fragmentcolumnAliases
- The column aliasestypes
- The resulting typesSQLProjection
Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.