Top Description Constructors Methods
org.hibernate.criterion

public final Class Projections

extends Object
Class Inheritance
Imports
org.hibernate.type.Type

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.
Author
Gavin King
See Also
org.hibernate.Criteria, factory methods for <tt>Criterion</tt> instances

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Projection
alias(Projection projection, String alias)

Assign an alias to a projection, by wrapping it

public static AggregateProjection
avg(String propertyName)

A property average value

public static CountProjection
count(String propertyName)

A property value count

public static CountProjection
countDistinct(String propertyName)

A distinct property value count

public static Projection
distinct(Projection proj)

Create a distinct projection from a projection

public static PropertyProjection
groupProperty(String propertyName)

A grouping property value

public static IdentifierProjection
id()

A projected identifier value

public static AggregateProjection
max(String propertyName)

A property maximum value

public static AggregateProjection
min(String propertyName)

A property minimum value

public static ProjectionList
projectionList()

Create a new projection list

public static PropertyProjection
property(String propertyName)

A projected property value

public static Projection
rowCount()

The query row count, ie.

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

public static Projection
sqlProjection(String sql, String[] columnAliases, Type[] types)

A SQL projection, a typed select clause fragment

public static AggregateProjection
sum(String propertyName)

A property value sum

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Projectionsback to summary
private Projections()

Method Detail

aliasback to summary
public static Projection alias(Projection projection, String alias)

Assign an alias to a projection, by wrapping it

avgback to summary
public static AggregateProjection avg(String propertyName)

A property average value

countback to summary
public static CountProjection count(String propertyName)

A property value count

countDistinctback to summary
public static CountProjection countDistinct(String propertyName)

A distinct property value count

distinctback to summary
public static Projection distinct(Projection proj)

Create a distinct projection from a projection

groupPropertyback to summary
public static PropertyProjection groupProperty(String propertyName)

A grouping property value

idback to summary
public static IdentifierProjection id()

A projected identifier value

maxback to summary
public static AggregateProjection max(String propertyName)

A property maximum value

minback to summary
public static AggregateProjection min(String propertyName)

A property minimum value

projectionListback to summary
public static ProjectionList projectionList()

Create a new projection list

propertyback to summary
public static PropertyProjection property(String propertyName)

A projected property value

rowCountback to summary
public static Projection rowCount()

The query row count, ie. count(*)

sqlGroupProjectionback to summary
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

sqlProjectionback to summary
public static Projection sqlProjection(String sql, String[] columnAliases, Type[] types)

A SQL projection, a typed select clause fragment

sumback to summary
public static AggregateProjection sum(String propertyName)

A property value sum