类 CriteriaQueryTranslator
- java.lang.Object
-
- org.hibernate.loader.criteria.CriteriaQueryTranslator
-
- 所有已实现的接口:
CriteriaQuery
public class CriteriaQueryTranslator extends Object implements CriteriaQuery
- 作者:
- Gavin King
-
-
字段概要
字段 修饰符和类型 字段 说明 static StringROOT_SQL_ALIAS
-
构造器概要
构造器 构造器 说明 CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias)CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias, CriteriaQuery outerQuery)
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 String[]findColumns(String propertyName, Criteria subcriteria)Get the names of the columns mapped by a property path; if the property path is not found in subcriteria, try the "outer" query.StringgenerateSQLAlias()Generate a unique SQL aliasStringgetColumn(Criteria criteria, String propertyName)Resolve a property path to the name of the column it maps to.String[]getColumns(String propertyName, Criteria subcriteria)Resolve a property path to the names of the columns it maps to.String[]getColumnsUsingProjection(Criteria subcriteria, String propertyName)Get the names of the columns constrained by this criterion.CriteriagetCriteria(String path)StringgetEntityName(Criteria criteria)Get the entity name of an entityStringgetEntityName(Criteria subcriteria, String propertyName)Get the entity name of an entity, taking into account the qualifier of the property pathSessionFactoryImplementorgetFactory()Provides access to the SessionFactoryStringgetGroupBy()String[]getIdentifierColumns(Criteria criteria)Get the identifier column names of this entityTypegetIdentifierType(Criteria criteria)Get the identifier type of this entityJoinTypegetJoinType(String path)StringgetOrderBy()String[]getProjectedAliases()String[]getProjectedColumnAliases()Type[]getProjectedTypes()StringgetPropertyName(String propertyName)Get the property name, given a possibly qualified property nameQueryParametersgetQueryParameters()Set<Serializable>getQuerySpaces()CriteriaImplgetRootCriteria()StringgetRootSQLALias()StringgetSelect()StringgetSQLAlias(Criteria criteria)Get the root table alias of an entityStringgetSQLAlias(Criteria criteria, String propertyName)Get the root table alias of an entity, taking into account the qualifier of the property pathintgetSQLAliasCount()TypegetType(Criteria subcriteria, String propertyName)Get the type of a property path.TypedValuegetTypedIdentifierValue(Criteria criteria, Object value)Build a TypedValue for the given identifier value.TypedValuegetTypedValue(Criteria subcriteria, String propertyName, Object value)Get the typed value for the given property value.TypegetTypeUsingProjection(Criteria subcriteria, String propertyName)Get the type of a property path.StringgetWhereCondition()StringgetWithClause(String path)booleanhasProjection()booleanhasRestriction(String path)booleanisJoin(String path)voidsetAssociations(Set<String> associations)
-
-
-
构造器详细资料
-
CriteriaQueryTranslator
public CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias, CriteriaQuery outerQuery) throws HibernateException
-
CriteriaQueryTranslator
public CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias) throws HibernateException
-
-
方法详细资料
-
generateSQLAlias
public String generateSQLAlias()
从接口复制的说明:CriteriaQueryGenerate a unique SQL alias- 指定者:
generateSQLAlias在接口中CriteriaQuery- 返回:
- The generated alias
-
getRootSQLALias
public String getRootSQLALias()
-
isJoin
public boolean isJoin(String path)
-
getQuerySpaces
public Set<Serializable> getQuerySpaces()
-
getSQLAliasCount
public int getSQLAliasCount()
-
getRootCriteria
public CriteriaImpl getRootCriteria()
-
getQueryParameters
public QueryParameters getQueryParameters()
-
hasProjection
public boolean hasProjection()
-
getGroupBy
public String getGroupBy()
-
getSelect
public String getSelect()
-
getProjectedTypes
public Type[] getProjectedTypes()
-
getProjectedColumnAliases
public String[] getProjectedColumnAliases()
-
getProjectedAliases
public String[] getProjectedAliases()
-
getWhereCondition
public String getWhereCondition()
-
getOrderBy
public String getOrderBy()
-
getFactory
public SessionFactoryImplementor getFactory()
从接口复制的说明:CriteriaQueryProvides access to the SessionFactory- 指定者:
getFactory在接口中CriteriaQuery- 返回:
- The SessionFactory
-
getSQLAlias
public String getSQLAlias(Criteria criteria)
从接口复制的说明:CriteriaQueryGet the root table alias of an entity- 指定者:
getSQLAlias在接口中CriteriaQuery- 参数:
criteria- The criteria- 返回:
- The SQL table alias for the given criteria
-
getEntityName
public String getEntityName(Criteria criteria)
从接口复制的说明:CriteriaQueryGet the entity name of an entity- 指定者:
getEntityName在接口中CriteriaQuery- 参数:
criteria- The criteria- 返回:
- The entity name
-
getColumn
public String getColumn(Criteria criteria, String propertyName)
从接口复制的说明:CriteriaQueryResolve a property path to the name of the column it maps to. Ignores projection aliases.- 指定者:
getColumn在接口中CriteriaQuery- 参数:
criteria- The overall criteriapropertyName- The property path to resolve- 返回:
- The column name
- 另请参阅:
CriteriaQuery.getColumns(java.lang.String, org.hibernate.Criteria)
-
getColumnsUsingProjection
public String[] getColumnsUsingProjection(Criteria subcriteria, String propertyName) throws HibernateException
Get the names of the columns constrained by this criterion.- 指定者:
getColumnsUsingProjection在接口中CriteriaQuery- 参数:
subcriteria- The criteriapropertyName- The property path to resolve or projection alias- 返回:
- The column names
- 抛出:
HibernateException- if the property/alias could not be resolved
-
getIdentifierColumns
public String[] getIdentifierColumns(Criteria criteria)
从接口复制的说明:CriteriaQueryGet the identifier column names of this entity- 指定者:
getIdentifierColumns在接口中CriteriaQuery- 参数:
criteria- The criteria- 返回:
- The identifier column names
-
getIdentifierType
public Type getIdentifierType(Criteria criteria)
从接口复制的说明:CriteriaQueryGet the identifier type of this entity- 指定者:
getIdentifierType在接口中CriteriaQuery- 参数:
criteria- The criteria- 返回:
- The identifier type.
-
getTypedIdentifierValue
public TypedValue getTypedIdentifierValue(Criteria criteria, Object value)
从接口复制的说明:CriteriaQueryBuild a TypedValue for the given identifier value.- 指定者:
getTypedIdentifierValue在接口中CriteriaQuery- 参数:
criteria- The criteria whose identifier is referenced.value- The identifier value- 返回:
- The TypedValue
-
getColumns
public String[] getColumns(String propertyName, Criteria subcriteria) throws HibernateException
从接口复制的说明:CriteriaQueryResolve a property path to the names of the columns it maps to. Ignores projection aliases- 指定者:
getColumns在接口中CriteriaQuery- 参数:
propertyName- The property path to resolvesubcriteria- The criteria- 返回:
- The column names
- 抛出:
HibernateException- if the property maps to more than 1 column, or if the property could not be resolved
-
findColumns
public String[] findColumns(String propertyName, Criteria subcriteria) throws HibernateException
Get the names of the columns mapped by a property path; if the property path is not found in subcriteria, try the "outer" query. Projection aliases are ignored.- 指定者:
findColumns在接口中CriteriaQuery- 参数:
propertyName- The property path to resolvesubcriteria- The criteria- 返回:
- The column names
- 抛出:
HibernateException- if the property could not be resolved
-
getTypeUsingProjection
public Type getTypeUsingProjection(Criteria subcriteria, String propertyName) throws HibernateException
从接口复制的说明:CriteriaQueryGet the type of a property path. Here, the property path can refer to a projection alias.- 指定者:
getTypeUsingProjection在接口中CriteriaQuery- 参数:
subcriteria- The criteriapropertyName- The property path to resolve or projection alias- 返回:
- The type
- 抛出:
HibernateException- if the property/alias could not be resolved
-
getType
public Type getType(Criteria subcriteria, String propertyName) throws HibernateException
从接口复制的说明:CriteriaQueryGet the type of a property path.- 指定者:
getType在接口中CriteriaQuery- 参数:
subcriteria- The criteriapropertyName- The property path to resolve- 返回:
- The type
- 抛出:
HibernateException- if the property could not be resolved
-
getTypedValue
public TypedValue getTypedValue(Criteria subcriteria, String propertyName, Object value) throws HibernateException
Get the typed value for the given property value.- 指定者:
getTypedValue在接口中CriteriaQuery- 参数:
subcriteria- The criteria querypropertyName- The property path/alias to resolve to type.value- The value- 返回:
- The TypedValue
- 抛出:
HibernateException- if the property/alias could not be resolved
-
getEntityName
public String getEntityName(Criteria subcriteria, String propertyName)
从接口复制的说明:CriteriaQueryGet the entity name of an entity, taking into account the qualifier of the property path- 指定者:
getEntityName在接口中CriteriaQuery- 参数:
subcriteria- The criteriapropertyName- The property path that (supposedly) references an entity- 返回:
- The entity name
-
getSQLAlias
public String getSQLAlias(Criteria criteria, String propertyName)
从接口复制的说明:CriteriaQueryGet the root table alias of an entity, taking into account the qualifier of the property path- 指定者:
getSQLAlias在接口中CriteriaQuery- 参数:
criteria- The criteriapropertyName- The property path whose SQL alias should be returned.- 返回:
- The SQL table alias for the given criteria
-
getPropertyName
public String getPropertyName(String propertyName)
从接口复制的说明:CriteriaQueryGet the property name, given a possibly qualified property name- 指定者:
getPropertyName在接口中CriteriaQuery- 参数:
propertyName- The (possibly qualified) property name- 返回:
- The simple property name
-
hasRestriction
public boolean hasRestriction(String path)
-
-