FileDocCategorySizeDatePackage
Projections.javaAPI DocHibernate 3.2.53269Tue May 31 15:24:42 BST 2005org.hibernate.criterion

Projections

public final class Projections extends Object
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.
see
org.hibernate.Criteria
see
Restrictions factory methods for Criterion instances
author
Gavin King

Fields Summary
Constructors Summary
private Projections()

		//cannot be instantiated
	
Methods Summary
public static Projectionalias(Projection projection, java.lang.String alias)
Assign an alias to a projection, by wrapping it

		return new AliasedProjection(projection, alias);
	
public static AggregateProjectionavg(java.lang.String propertyName)
A property average value

		return new AvgProjection(propertyName);
	
public static CountProjectioncount(java.lang.String propertyName)
A property value count

		return new CountProjection(propertyName);
	
public static CountProjectioncountDistinct(java.lang.String propertyName)
A distinct property value count

		return new CountProjection(propertyName).setDistinct();
	
public static Projectiondistinct(Projection proj)
Create a distinct projection from a projection

		return new Distinct(proj);
	
public static PropertyProjectiongroupProperty(java.lang.String propertyName)
A grouping property value

		return new PropertyProjection(propertyName, true);
	
public static IdentifierProjectionid()
A projected identifier value

		return new IdentifierProjection();
	
public static AggregateProjectionmax(java.lang.String propertyName)
A property maximum value

		return new AggregateProjection("max", propertyName);
	
public static AggregateProjectionmin(java.lang.String propertyName)
A property minimum value

		return new AggregateProjection("min", propertyName);
	
public static ProjectionListprojectionList()
Create a new projection list

		return new ProjectionList();
	
public static PropertyProjectionproperty(java.lang.String propertyName)
A projected property value

		return new PropertyProjection(propertyName);
	
public static ProjectionrowCount()
The query row count, ie. count(*)

		return new RowCountProjection();
	
public static ProjectionsqlGroupProjection(java.lang.String sql, java.lang.String groupBy, java.lang.String[] columnAliases, org.hibernate.type.Type[] types)
A grouping SQL projection, specifying both select clause and group by clause fragments

		return new SQLProjection(sql, groupBy, columnAliases, types);
	
public static ProjectionsqlProjection(java.lang.String sql, java.lang.String[] columnAliases, org.hibernate.type.Type[] types)
A SQL projection, a typed select clause fragment

		return new SQLProjection(sql, columnAliases, types);
	
public static AggregateProjectionsum(java.lang.String propertyName)
A property value sum

		return new AggregateProjection("sum", propertyName);