Top Description Fields Constructors Methods
org.hibernate.criterion

public Class CountProjection

extends AggregateProjection
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .List, org.hibernate.Criteria

A count projection
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private boolean
Inherited from org.hibernate.criterion.AggregateProjection:
propertyName

Constructor Summary

AccessConstructor and Description
protected
CountProjection(String
The property name
prop
)

Constructs the count projection.

Method Summary

Modifier and TypeMethod and Description
private List<E>
protected List<E>
public CountProjection

Returns:

this, for method chaining
setDistinct
()

Sets the count as being distinct

public String
toString()

Overrides org.hibernate.criterion.AggregateProjection.toString.

Returns a string representation of the object.
Inherited from org.hibernate.criterion.AggregateProjection:
buildFunctionParameterListgetFunctiongetFunctiongetFunctionNamegetPropertyNamegetTypestoSqlString

Field Detail

distinctback to summary
private boolean distinct

Constructor Detail

CountProjectionback to summary
protected CountProjection(String prop)

Constructs the count projection.

Parameters
prop:String

The property name

See Also
Projections#count(String), Projections#countDistinct(String)

Method Detail

buildCountDistinctParameterListback to summary
private List<E> buildCountDistinctParameterList(String[] cols)
Annotations
@SuppressWarnings:unchecked
buildFunctionParameterListback to summary
protected List<E> buildFunctionParameterList(Criteria criteria, CriteriaQuery criteriaQuery)

Overrides org.hibernate.criterion.AggregateProjection.buildFunctionParameterList.

Annotations
@Override
setDistinctback to summary
public CountProjection setDistinct()

Sets the count as being distinct

Returns:CountProjection

this, for method chaining

toStringback to summary
public String toString()

Overrides org.hibernate.criterion.AggregateProjection.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override