. However, it is intended that most applications will
simply use the built-in projection types via the static factory methods of this class.
The factory methods that take an alias allow the projected value to be referred to by
criterion and order instances.
| Method from org.hibernate.criterion.Projections Detail: |
public static Projection alias(Projection projection,
String alias) {
return new AliasedProjection(projection, alias);
}
Assign an alias to a projection, by wrapping it |
public static AggregateProjection avg(String propertyName) {
return new AvgProjection(propertyName);
}
|
public static CountProjection count(String propertyName) {
return new CountProjection(propertyName);
}
|
public static CountProjection countDistinct(String propertyName) {
return new CountProjection(propertyName).setDistinct();
}
A distinct property value count |
public static Projection distinct(Projection proj) {
return new Distinct(proj);
}
Create a distinct projection from a projection |
public static PropertyProjection groupProperty(String propertyName) {
return new PropertyProjection(propertyName, true);
}
A grouping property value |
public static IdentifierProjection id() {
return new IdentifierProjection();
}
A projected identifier value |
public static AggregateProjection max(String propertyName) {
return new AggregateProjection("max", propertyName);
}
|
public static AggregateProjection min(String propertyName) {
return new AggregateProjection("min", propertyName);
}
|
public static ProjectionList projectionList() {
return new ProjectionList();
}
Create a new projection list |
public static PropertyProjection property(String propertyName) {
return new PropertyProjection(propertyName);
}
A projected property value |
public static Projection rowCount() {
return new RowCountProjection();
}
The query row count, ie. count(*) |
public static Projection sqlGroupProjection(String sql,
String groupBy,
String[] columnAliases,
Type[] types) {
return new SQLProjection(sql, groupBy, columnAliases, types);
}
A grouping SQL projection, specifying both select clause and group by clause fragments |
public static Projection sqlProjection(String sql,
String[] columnAliases,
Type[] types) {
return new SQLProjection(sql, columnAliases, types);
}
A SQL projection, a typed select clause fragment |
public static AggregateProjection sum(String propertyName) {
return new AggregateProjection("sum", propertyName);
}
|