org.hibernate.criterion
Class Projections

public class 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.
SinceNot specified.
VersionNot specified.
AuthorGavin King
Wiki javadoc Use textile entry format.
Add your comments here.
Method Summary
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
static CountProjection count( String propertyName )
A property value count
static CountProjection countDistinct( String propertyName )
A distinct property value count
static Projection distinct( Projection proj )
Create a distinct projection from a projection
static PropertyProjection groupProperty( String propertyName )
A grouping property value
static IdentifierProjection id()
A projected identifier value
static AggregateProjection max( String propertyName )
A property maximum value
static AggregateProjection min( String propertyName )
A property minimum value
static ProjectionList projectionList()
Create a new projection list
static PropertyProjection property( String propertyName )
A projected property value
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
alias
public static Projection alias ( Projection projection, String alias )
Assign an alias to a projection, by wrapping it
Parameters
TypeNameDescription
Projection projection No description provided.
String alias No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
avg
public static AggregateProjection avg ( String propertyName )
A property average value
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
count
public static CountProjection count ( String propertyName )
A property value count
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
countDistinct
public static CountProjection countDistinct ( String propertyName )
A distinct property value count
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
distinct
public static Projection distinct ( Projection proj )
Create a distinct projection from a projection
Parameters
TypeNameDescription
Projection proj No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
groupProperty
public static PropertyProjection groupProperty ( String propertyName )
A grouping property value
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
id
public static IdentifierProjection id ( )
A projected identifier value
Wiki javadoc Use textile entry format.
Add your comments here.
max
public static AggregateProjection max ( String propertyName )
A property maximum value
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
min
public static AggregateProjection min ( String propertyName )
A property minimum value
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
projectionList
public static ProjectionList projectionList ( )
Create a new projection list
Wiki javadoc Use textile entry format.
Add your comments here.
property
public static PropertyProjection property ( String propertyName )
A projected property value
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
rowCount
public static Projection rowCount ( )
The query row count, ie. count(*)
Wiki javadoc Use textile entry format.
Add your comments here.
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
Parameters
TypeNameDescription
String sql No description provided.
String groupBy No description provided.
String [] columnAliases No description provided.
Type [] types No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
sqlProjection
public static Projection sqlProjection ( String sql, String [] columnAliases, Type [] types )
A SQL projection, a typed select clause fragment
Parameters
TypeNameDescription
String sql No description provided.
String [] columnAliases No description provided.
Type [] types No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.
sum
public static AggregateProjection sum ( String propertyName )
A property value sum
Parameters
TypeNameDescription
String propertyName No description provided.
Wiki javadoc Use textile entry format.
Add your comments here.