类 SimpleProjection
- java.lang.Object
-
- org.hibernate.criterion.SimpleProjection
-
- 所有已实现的接口:
Serializable,EnhancedProjection,Projection
public abstract class SimpleProjection extends Object implements EnhancedProjection
A single-column projection that may be aliased- 作者:
- Gavin King
- 另请参阅:
- 序列化表格
-
-
构造器概要
构造器 构造器 说明 SimpleProjection()
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Projectionas(String alias)Create an aliased form of this projectionString[]getAliases()Get the criteria-level aliases for this projection (ie. the ones that will be passed to theResultTransformer)String[]getColumnAliases(int loc)Get the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery).String[]getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery)Get the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery).String[]getColumnAliases(String alias, int loc)Get the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery)for a particular criteria-level alias.String[]getColumnAliases(String alias, int loc, Criteria criteria, CriteriaQuery criteriaQuery)Get the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery)for a particular criteria-level alias.intgetColumnCount(Criteria criteria, CriteriaQuery criteriaQuery)Count the number of columns this projection uses.Type[]getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)Get the return types for a particular user-visible alias.booleanisGrouped()Is this projection fragment (SELECT clause) also part of the GROUP BYStringtoGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)Render the SQL fragment to be used in the GROUP BY clause-
从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
从接口继承的方法 org.hibernate.criterion.Projection
getTypes, toSqlString
-
-
-
-
方法详细资料
-
as
public Projection as(String alias)
Create an aliased form of this projection- 参数:
alias- The alias to apply- 返回:
- The aliased projection
-
getColumnAliases
public String[] getColumnAliases(String alias, int loc)
从接口复制的说明:ProjectionGet the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery)for a particular criteria-level alias.- 指定者:
getColumnAliases在接口中Projection- 参数:
alias- The criteria-level aliasloc- Just as inProjection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery), represents the number of columns rendered prior to this projection.- 返回:
- The columns aliases pertaining to a particular criteria-level alias; expected to return null if this projection does not understand this alias.
-
getColumnAliases
public String[] getColumnAliases(String alias, int loc, Criteria criteria, CriteriaQuery criteriaQuery)
从接口复制的说明:EnhancedProjectionGet the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery)for a particular criteria-level alias.- 指定者:
getColumnAliases在接口中EnhancedProjection- 参数:
alias- The criteria-level aliasloc- Just as inProjection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery), represents the number of columns rendered prior to this projection.criteria- The local criteria to which this project is attached (for resolution).criteriaQuery- The overall criteria query instance.- 返回:
- The columns aliases pertaining to a particular criteria-level alias; expected to return null if this projection does not understand this alias.
-
getTypes
public Type[] getTypes(String alias, Criteria criteria, CriteriaQuery criteriaQuery)
从接口复制的说明:ProjectionGet the return types for a particular user-visible alias. Differs fromProjection.getTypes(org.hibernate.Criteria, CriteriaQuery)in that here we are only interested in the types related to the given criteria-level alias.- 指定者:
getTypes在接口中Projection- 参数:
alias- The criteria-level alias for which to find types.criteria- The local criteria to which this project is attached (for resolution).criteriaQuery- The overall criteria query instance.- 返回:
- The return types; expected to return null if this projection does not understand this alias.
-
getColumnAliases
public String[] getColumnAliases(int loc)
从接口复制的说明:ProjectionGet the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery). Hibernate always uses column aliases to extract data from the JDBCResultSet, so it is important that these be implemented correctly in order for Hibernate to be able to extract these values correctly.- 指定者:
getColumnAliases在接口中Projection- 参数:
loc- Just as inProjection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery), represents the number of columns rendered prior to this projection.- 返回:
- The columns aliases.
-
getColumnCount
public int getColumnCount(Criteria criteria, CriteriaQuery criteriaQuery)
Count the number of columns this projection uses.- 参数:
criteria- The criteriacriteriaQuery- The query- 返回:
- The number of columns
-
getColumnAliases
public String[] getColumnAliases(int loc, Criteria criteria, CriteriaQuery criteriaQuery)
从接口复制的说明:EnhancedProjectionGet the SQL column aliases used by this projection for the columns it writes for inclusion into the SELECT clause (Projection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery). Hibernate always uses column aliases to extract data from the JDBCResultSet, so it is important that these be implemented correctly in order for Hibernate to be able to extract these values correctly.- 指定者:
getColumnAliases在接口中EnhancedProjection- 参数:
loc- Just as inProjection.toSqlString(org.hibernate.Criteria, int, org.hibernate.criterion.CriteriaQuery), represents the number of columns rendered prior to this projection.criteria- The local criteria to which this project is attached (for resolution).criteriaQuery- The overall criteria query instance.- 返回:
- The columns aliases.
-
getAliases
public String[] getAliases()
从接口复制的说明:ProjectionGet the criteria-level aliases for this projection (ie. the ones that will be passed to theResultTransformer)- 指定者:
getAliases在接口中Projection- 返回:
- The aliases
-
toGroupSqlString
public String toGroupSqlString(Criteria criteria, CriteriaQuery criteriaQuery)
从接口复制的说明:ProjectionRender the SQL fragment to be used in the GROUP BY clause- 指定者:
toGroupSqlString在接口中Projection- 参数:
criteria- The local criteria to which this project is attached (for resolution).criteriaQuery- The overall criteria query instance.- 返回:
- The SQL fragment to plug into the GROUP BY
-
isGrouped
public boolean isGrouped()
从接口复制的说明:ProjectionIs this projection fragment (SELECT clause) also part of the GROUP BY- 指定者:
isGrouped在接口中Projection- 返回:
- True if the projection is also part of the GROUP BY; false otherwise.
-
-