org.hibernate.criterion

Class PropertyProjection

Implemented Interfaces:
Projection, Serializable
Known Direct Subclasses:
Property

public class PropertyProjection
extends SimpleProjection

A property value, or grouped property value
Author:
Gavin King

Constructor Summary

PropertyProjection(String prop)
PropertyProjection(String prop, boolean grouped)

Method Summary

String
getPropertyName()
Type[]
getTypes(Criteria criteria, CriteriaQuery criteriaQuery)
Return types returned by the rendered SQL fragment
boolean
isGrouped()
Does this projection specify grouping attributes?
String
toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
Render the SQL fragment to be used in the group by clause
String
toSqlString(Criteria criteria, int position, CriteriaQuery criteriaQuery)
Render the SQL fragment
String
toString()

Methods inherited from class org.hibernate.criterion.SimpleProjection

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

Constructor Details

PropertyProjection

protected PropertyProjection(String prop)

PropertyProjection

protected PropertyProjection(String prop,
                             boolean grouped)

Method Details

getPropertyName

public String getPropertyName()

getTypes

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

isGrouped

public boolean isGrouped()
Does this projection specify grouping attributes?
Specified by:
isGrouped in interface Projection
Overrides:
isGrouped in interface SimpleProjection

toGroupSqlString

public String toGroupSqlString(Criteria criteria,
                               CriteriaQuery criteriaQuery)
            throws HibernateException
Render the SQL fragment to be used in the group by clause
Specified by:
toGroupSqlString in interface Projection
Overrides:
toGroupSqlString in interface SimpleProjection
Parameters:
criteriaQuery -
Returns:
String

toSqlString

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

toString

public String toString()