Package org.hibernate.criterion
Class CountProjection
- java.lang.Object
-
- org.hibernate.criterion.SimpleProjection
-
- org.hibernate.criterion.AggregateProjection
-
- org.hibernate.criterion.CountProjection
-
- All Implemented Interfaces:
java.io.Serializable,EnhancedProjection,Projection
public class CountProjection extends AggregateProjection
A count projection- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.hibernate.criterion.AggregateProjection
propertyName
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedCountProjection(java.lang.String prop)Constructs the count projection.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.util.ListbuildFunctionParameterList(Criteria criteria, CriteriaQuery criteriaQuery)CountProjectionsetDistinct()Sets the count as being distinctjava.lang.StringtoString()-
Methods inherited from class org.hibernate.criterion.AggregateProjection
buildFunctionParameterList, getFunction, getFunction, getFunctionName, getPropertyName, getTypes, toSqlString
-
Methods inherited from class org.hibernate.criterion.SimpleProjection
as, getAliases, getColumnAliases, getColumnAliases, getColumnAliases, getColumnAliases, getColumnCount, getTypes, isGrouped, toGroupSqlString
-
-
-
-
Constructor Detail
-
CountProjection
protected CountProjection(java.lang.String prop)
Constructs the count projection.- Parameters:
prop- The property name- See Also:
Projections.count(String),Projections.countDistinct(String)
-
-
Method Detail
-
buildFunctionParameterList
protected java.util.List buildFunctionParameterList(Criteria criteria, CriteriaQuery criteriaQuery)
- Overrides:
buildFunctionParameterListin classAggregateProjection
-
setDistinct
public CountProjection setDistinct()
Sets the count as being distinct- Returns:
this, for method chaining
-
toString
public java.lang.String toString()
- Overrides:
toStringin classAggregateProjection
-
-