org.hibernate.criterion

Class CountProjection

Implemented Interfaces:
Projection, Serializable

public class CountProjection
extends AggregateProjection

A count
Author:
Gavin King

Field Summary

Fields inherited from class org.hibernate.criterion.AggregateProjection

propertyName

Constructor Summary

CountProjection(String prop)

Method Summary

Type[]
getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
Return types returned by the rendered SQL fragment
CountProjection
setDistinct()
String
toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
Render the SQL fragment
String
toString()

Methods inherited from class org.hibernate.criterion.AggregateProjection

getTypes, toSqlString, toString

Methods inherited from class org.hibernate.criterion.SimpleProjection

as, getAliases, getColumnAliases, getColumnAliases, getTypes, isGrouped, toGroupSqlString

Constructor Details

CountProjection

protected CountProjection(String prop)

Method Details

getTypes

public Type[] getTypes(Criteria criteria,
                       CriteriaQuery criteriaQuery)
            throws HibernateException
Return types returned by the rendered SQL fragment
Specified by:
getTypes in interface Projection
Overrides:
getTypes in interface AggregateProjection
Parameters:
criteria -
criteriaQuery -
Returns:
Type[]

setDistinct

public CountProjection setDistinct()

toSqlString

public String toSqlString(Criteria criteria,
                          int position,
                          CriteriaQuery criteriaQuery)
            throws HibernateException
Render the SQL fragment
Specified by:
toSqlString in interface Projection
Overrides:
toSqlString in interface AggregateProjection
Parameters:
criteriaQuery -
Returns:
String

toString

public String toString()
Overrides:
toString in interface AggregateProjection