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 projectedPropertyProjectionpublic static PropertyProjection groupProperty(java.lang.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(java.lang.String propertyName)
propertyName - The name of the property to count overCountProjectionpublic static CountProjection countDistinct(java.lang.String propertyName)
propertyName - The name of the property to count overCountProjectionpublic static AggregateProjection max(java.lang.String propertyName)
propertyName - The property for which to find the maxAggregateProjectionpublic static AggregateProjection min(java.lang.String propertyName)
propertyName - The property for which to find the minAggregateProjectionpublic static AggregateProjection avg(java.lang.String propertyName)
propertyName - The property over which to find the averageAvgProjectionpublic static AggregateProjection sum(java.lang.String propertyName)
propertyName - The property over which to sumAggregateProjectionpublic static Projection alias(Projection projection, java.lang.String alias)
projection - The projection to be aliasedalias - The alias to applyAliasedProjectionpublic static Projection sqlProjection(java.lang.String sql, java.lang.String[] columnAliases, Type[] types)
sql - The SQL fragmentcolumnAliases - The column aliasestypes - The resulting typesSQLProjectionpublic 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 typesSQLProjectionCopyright © 2001-2018 Red Hat, Inc. All Rights Reserved.