Package org.hibernate.criterion
Class Projections
java.lang.Object
org.hibernate.criterion.Projections
The criterion package may be used by applications as a framework for building
new kinds of Projection. 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.
The factory methods that take an alias allow the projected value to be referred to by criterion and order instances.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic Projectionalias(Projection projection, String alias) Assign an alias to a projection, by wrapping itstatic AggregateProjectionA property average valuestatic CountProjectionA property value countstatic CountProjectioncountDistinct(String propertyName) A distinct property value countstatic Projectiondistinct(Projection proj) Create a distinct projection from a projectionstatic PropertyProjectiongroupProperty(String propertyName) A grouping property valuestatic IdentifierProjectionid()A projected identifier valuestatic AggregateProjectionA property maximum valuestatic AggregateProjectionA property minimum valuestatic ProjectionListCreate a new projection liststatic PropertyProjectionA projected property valuestatic ProjectionrowCount()The query row count, ie.static ProjectionsqlGroupProjection(String sql, String groupBy, String[] columnAliases, Type[] types) A grouping SQL projection, specifying both select clause and group by clause fragmentsstatic ProjectionsqlProjection(String sql, String[] columnAliases, Type[] types) A SQL projection, a typed select clause fragmentstatic AggregateProjectionA property value sum
-
Method Details
-
distinct
Create a distinct projection from a projection -
projectionList
Create a new projection list -
rowCount
The query row count, ie. count(*) -
count
A property value count -
countDistinct
A distinct property value count -
max
A property maximum value -
min
A property minimum value -
avg
A property average value -
sum
A property value sum -
sqlProjection
A SQL projection, a typed select clause fragment -
sqlGroupProjection
public static Projection sqlGroupProjection(String sql, String groupBy, String[] columnAliases, Type[] types) A grouping SQL projection, specifying both select clause and group by clause fragments -
groupProperty
A grouping property value -
property
A projected property value -
id
A projected identifier value -
alias
Assign an alias to a projection, by wrapping it
-