Save This Page
Home » hibernate-core-src-20081106 » org.hibernate » criterion » [javadoc | source]
org.hibernate.criterion
public interface: Projection [javadoc | source]

All Implemented Interfaces:
    Serializable

All Known Implementing Classes:
    CountProjection, AliasedProjection, AvgProjection, PropertyProjection, AggregateProjection, Property, IdentifierProjection, ProjectionList, RowCountProjection, SimpleProjection, SQLProjection, Distinct

An object-oriented representation of a query result set projection in a Criteria query. Built-in projection types are provided by the Projections factory class. This interface might be implemented by application classes that define custom projections.
Method from org.hibernate.criterion.Projection Summary:
getAliases,   getColumnAliases,   getColumnAliases,   getTypes,   getTypes,   isGrouped,   toGroupSqlString,   toSqlString
Method from org.hibernate.criterion.Projection Detail:
 public String[] getAliases()
 public String[] getColumnAliases(int position)
    Get the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (#toSqlString . Hibernate always uses column aliases to extract data from the JDBC java.sql.ResultSet , so it is important that these be implemented correctly in order for Hibernate to be able to extract these val;ues correctly.
 public String[] getColumnAliases(String alias,
    int position)
    Get the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (#toSqlString for a particular criteria-level alias.
 public Type[] getTypes(Criteria criteria,
    CriteriaQuery criteriaQuery) throws HibernateException
    Types returned by the rendered SQL fragment . In other words what are the types that would represent the values this projection asked to be pulled into the result set?
 public Type[] getTypes(String alias,
    Criteria criteria,
    CriteriaQuery criteriaQuery) throws HibernateException
 public boolean isGrouped()
    Is this projection fragment (SELECT clause) also part of the GROUP BY
 public String toGroupSqlString(Criteria criteria,
    CriteriaQuery criteriaQuery) throws HibernateException
    Render the SQL fragment to be used in the GROUP BY clause
 public String toSqlString(Criteria criteria,
    int position,
    CriteriaQuery criteriaQuery) throws HibernateException
    Render the SQL fragment to be used in the SELECT clause.