public class CriteriaQueryTranslator extends Object implements CriteriaQuery
Modifier and Type | Field and Description |
---|---|
static String |
ROOT_SQL_ALIAS |
Constructor and Description |
---|
CriteriaQueryTranslator(SessionFactoryImplementor factory,
CriteriaImpl criteria,
String rootEntityName,
String rootSQLAlias) |
CriteriaQueryTranslator(SessionFactoryImplementor factory,
CriteriaImpl criteria,
String rootEntityName,
String rootSQLAlias,
CriteriaQuery outerQuery) |
Modifier and Type | Method and Description |
---|---|
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.
|
String |
generateSQLAlias()
Generate a unique SQL alias
|
String |
getColumn(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.
|
Criteria |
getCriteria(String path) |
String |
getEntityName(Criteria criteria)
Get the entity name of an entity
|
String |
getEntityName(Criteria subcriteria,
String propertyName)
Get the entity name of an entity, taking into account the qualifier of the property path
|
SessionFactoryImplementor |
getFactory()
Provides access to the SessionFactory
|
String |
getGroupBy() |
String[] |
getIdentifierColumns(Criteria criteria)
Get the identifier column names of this entity
|
Type |
getIdentifierType(Criteria criteria)
Get the identifier type of this entity
|
JoinType |
getJoinType(String path) |
String |
getOrderBy() |
String[] |
getProjectedAliases() |
String[] |
getProjectedColumnAliases() |
Type[] |
getProjectedTypes() |
String |
getPropertyName(String propertyName)
Get the property name, given a possibly qualified property name
|
QueryParameters |
getQueryParameters() |
Set<Serializable> |
getQuerySpaces() |
CriteriaImpl |
getRootCriteria() |
String |
getRootSQLALias() |
String |
getSelect() |
String |
getSQLAlias(Criteria criteria)
Get the root table alias of an entity
|
String |
getSQLAlias(Criteria criteria,
String propertyName)
Get the root table alias of an entity, taking into account
the qualifier of the property path
|
int |
getSQLAliasCount() |
Type |
getType(Criteria subcriteria,
String propertyName)
Get the type of a property path.
|
TypedValue |
getTypedIdentifierValue(Criteria criteria,
Object value)
Build a TypedValue for the given identifier value.
|
TypedValue |
getTypedValue(Criteria subcriteria,
String propertyName,
Object value)
Get the a typed value for the given property value.
|
Type |
getTypeUsingProjection(Criteria subcriteria,
String propertyName)
Get the type of a property path.
|
String |
getWhereCondition() |
String |
getWithClause(String path) |
boolean |
hasProjection() |
boolean |
hasRestriction(String path) |
boolean |
isJoin(String path) |
void |
setAssociations(Set<String> associations) |
public static final String ROOT_SQL_ALIAS
public CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias, CriteriaQuery outerQuery) throws HibernateException
HibernateException
public CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias) throws HibernateException
HibernateException
public String generateSQLAlias()
CriteriaQuery
generateSQLAlias
in interface CriteriaQuery
public String getRootSQLALias()
public boolean isJoin(String path)
public Set<Serializable> getQuerySpaces()
public int getSQLAliasCount()
public CriteriaImpl getRootCriteria()
public QueryParameters getQueryParameters()
public boolean hasProjection()
public String getGroupBy()
public String getSelect()
public Type[] getProjectedTypes()
public String[] getProjectedColumnAliases()
public String[] getProjectedAliases()
public String getWhereCondition()
public String getOrderBy()
public SessionFactoryImplementor getFactory()
CriteriaQuery
getFactory
in interface CriteriaQuery
public String getSQLAlias(Criteria criteria)
CriteriaQuery
getSQLAlias
in interface CriteriaQuery
criteria
- The criteriapublic String getEntityName(Criteria criteria)
CriteriaQuery
getEntityName
in interface CriteriaQuery
criteria
- The criteriapublic String getColumn(Criteria criteria, String propertyName)
CriteriaQuery
getColumn
in interface CriteriaQuery
criteria
- The overall criteriapropertyName
- The property path to resolveCriteriaQuery.getColumns(java.lang.String, org.hibernate.Criteria)
public String[] getColumnsUsingProjection(Criteria subcriteria, String propertyName) throws HibernateException
getColumnsUsingProjection
in interface CriteriaQuery
subcriteria
- The criteriapropertyName
- The property path to resolve or projection aliasHibernateException
- if the property/alias could not be resolvedpublic String[] getIdentifierColumns(Criteria criteria)
CriteriaQuery
getIdentifierColumns
in interface CriteriaQuery
criteria
- The criteriapublic Type getIdentifierType(Criteria criteria)
CriteriaQuery
getIdentifierType
in interface CriteriaQuery
criteria
- The criteriapublic TypedValue getTypedIdentifierValue(Criteria criteria, Object value)
CriteriaQuery
getTypedIdentifierValue
in interface CriteriaQuery
criteria
- The criteria whose identifier is referenced.value
- The identifier valuepublic String[] getColumns(String propertyName, Criteria subcriteria) throws HibernateException
CriteriaQuery
getColumns
in interface CriteriaQuery
propertyName
- The property path to resolvesubcriteria
- The criteriaHibernateException
- if the property maps to more than 1 column, or if the property could not be resolvedpublic String[] findColumns(String propertyName, Criteria subcriteria) throws HibernateException
findColumns
in interface CriteriaQuery
propertyName
- The property path to resolvesubcriteria
- The criteriaHibernateException
- if the property could not be resolvedpublic Type getTypeUsingProjection(Criteria subcriteria, String propertyName) throws HibernateException
CriteriaQuery
getTypeUsingProjection
in interface CriteriaQuery
subcriteria
- The criteriapropertyName
- The property path to resolve or projection aliasHibernateException
- if the property/alias could not be resolvedpublic Type getType(Criteria subcriteria, String propertyName) throws HibernateException
CriteriaQuery
getType
in interface CriteriaQuery
subcriteria
- The criteriapropertyName
- The property path to resolveHibernateException
- if the property could not be resolvedpublic TypedValue getTypedValue(Criteria subcriteria, String propertyName, Object value) throws HibernateException
getTypedValue
in interface CriteriaQuery
subcriteria
- The criteria querypropertyName
- The property path/alias to resolve to type.value
- The valueHibernateException
- if the property/alias could not be resolvedpublic String getEntityName(Criteria subcriteria, String propertyName)
CriteriaQuery
getEntityName
in interface CriteriaQuery
subcriteria
- The criteriapropertyName
- The property path that (supposedly) references an entitypublic String getSQLAlias(Criteria criteria, String propertyName)
CriteriaQuery
getSQLAlias
in interface CriteriaQuery
criteria
- The criteriapropertyName
- The property path whose SQL alias should be returned.public String getPropertyName(String propertyName)
CriteriaQuery
getPropertyName
in interface CriteriaQuery
propertyName
- The (possibly qualified) property namepublic boolean hasRestriction(String path)
Copyright © 2019 JBoss by Red Hat. All rights reserved.