Top Fields Constructors Methods
org.hibernate.loader.criteria

public Class CriteriaQueryTranslator

extends Object
implements CriteriaQuery
Class Inheritance
All Implemented Interfaces
org.hibernate.criterion.CriteriaQuery
Imports
java.io.Serializable, java.util.ArrayList, .Arrays, .HashMap, .HashSet, .Iterator, .LinkedHashMap, .List, .Map, .Set, .StringTokenizer, org.hibernate.Criteria, .HibernateException, .LockMode, .LockOptions, .MappingException, .QueryException, org.hibernate.criterion.CriteriaQuery, .Criterion, .EnhancedProjection, .Projection, org.hibernate.engine.spi.QueryParameters, .RowSelection, .SessionFactoryImplementor, .TypedValue, org.hibernate.hql.internal.ast.util.SessionFactoryHelper, org.hibernate.internal.CriteriaImpl, org.hibernate.internal.util.StringHelper, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.entity.EntityPersister, .Loadable, .PropertyMapping, .Queryable, org.hibernate.sql.JoinType, org.hibernate.type.AssociationType, .CollectionType, .ManyToOneType, .StringRepresentableType, .Type

Author
Gavin King

Field Summary

Modifier and TypeField and Description
private final Map<String, Criteria>
private final Map<String, Criteria>
private final Map<String, JoinType>
private Set<String>
private final Map<Criteria, CriteriaInfoProvider>
private final Map<Criteria, String>
private final SessionFactoryHelper
private final Map<String, CriteriaInfoProvider>
private CriteriaQuery
public static final String
private final CriteriaImpl
private final String
private final String
private final SessionFactoryImplementor
sessionFactory

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
private final Map<String, Criterion>

Constructor Summary

AccessConstructor and Description
public
CriteriaQueryTranslator(final SessionFactoryImplementor factory, final CriteriaImpl criteria, final String rootEntityName, final String rootSQLAlias, CriteriaQuery outerQuery)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
public
CriteriaQueryTranslator(final SessionFactoryImplementor factory, final CriteriaImpl criteria, final String rootEntityName, final String rootSQLAlias)

Deprecated as a consequence of SessionFactoryImplementor being deprecated.

Method Summary

Modifier and TypeMethod and Description
private Criteria
addInnerJoin(Criteria subcriteria, String root, CriteriaInfoProvider pathInfo)

private void
private void
private void
private void
public String[]
findColumns(String
The property path to resolve
propertyName
,
Criteria
The criteria
subcriteria
)

Implements org.hibernate.criterion.CriteriaQuery.findColumns.

Get the names of the columns mapped by a property path; if the property path is not found in subcriteria, try the "outer" query.
public String
private Criteria
public String
getColumn(Criteria
The overall criteria
criteria
,
String
The property path to resolve
propertyName
)

Implements org.hibernate.criterion.CriteriaQuery.getColumn.

Resolve a property path to the name of the column it maps to.
public String[]
getColumns(String
The property path to resolve
propertyName
,
Criteria
The criteria
subcriteria
)

Implements org.hibernate.criterion.CriteriaQuery.getColumns.

Resolve a property path to the names of the columns it maps to.
public String[]
getColumnsUsingProjection(Criteria
The criteria
subcriteria
,
String
The property path to resolve or projection alias
propertyName
)

Implements org.hibernate.criterion.CriteriaQuery.getColumnsUsingProjection.

Get the names of the columns constrained by this criterion.
public Criteria
public String
getEntityName(Criteria
The criteria
criteria
)

Implements org.hibernate.criterion.CriteriaQuery.getEntityName.

Get the entity name of an entity
public String
getEntityName(Criteria
The criteria
subcriteria
,
String
The property path that (supposedly) references an entity
propertyName
)

Implements org.hibernate.criterion.CriteriaQuery.getEntityName.

Get the entity name of an entity, taking into account the qualifier of the property path
public SessionFactoryImplementor
getFactory()

Implements org.hibernate.criterion.CriteriaQuery.getFactory.

Deprecated as a consequence of SessionFactoryImplementor being deprecated.
Provides access to the SessionFactory
public String[]
public Type
public TypedValue
public String
public String[]
getIdentifierColumns(Criteria
The criteria
criteria
)

Implements org.hibernate.criterion.CriteriaQuery.getIdentifierColumns.

Get the identifier column names of this entity
public Type
getIdentifierType(Criteria
The criteria
criteria
)

Implements org.hibernate.criterion.CriteriaQuery.getIdentifierType.

Get the identifier type of this entity
public JoinType
public String
private CriteriaInfoProvider
public String[]
public String[]
public Type[]
private PropertyMapping
public String
getPropertyName(String
The (possibly qualified) property name
propertyName
)

Implements org.hibernate.criterion.CriteriaQuery.getPropertyName.

Get the property name, given a possibly qualified property name
public QueryParameters
public Set<Serializable>
pack-priv Type
public CriteriaImpl
public String
public String
public String
getSQLAlias(Criteria
The criteria
criteria
)

Implements org.hibernate.criterion.CriteriaQuery.getSQLAlias.

Get the root table alias of an entity
public String
getSQLAlias(Criteria
The criteria
criteria
,
String
The property path whose SQL alias should be returned.
propertyName
)

Implements org.hibernate.criterion.CriteriaQuery.getSQLAlias.

Get the root table alias of an entity, taking into account the qualifier of the property path
public int
public Type
getType(Criteria
The criteria
subcriteria
,
String
The property path to resolve
propertyName
)

Implements org.hibernate.criterion.CriteriaQuery.getType.

Get the type of a property path.
public TypedValue
getTypedIdentifierValue(Criteria
The criteria whose identifier is referenced.
criteria
,
Object
The identifier value
value
)

Implements org.hibernate.criterion.CriteriaQuery.getTypedIdentifierValue.

Build a TypedValue for the given identifier value.
public TypedValue
getTypedValue(Criteria
The criteria query
subcriteria
,
String
The property path/alias to resolve to type.
propertyName
,
Object
The value
value
)

Implements org.hibernate.criterion.CriteriaQuery.getTypedValue.

Get the typed value for the given property value.
public Type
getTypeUsingProjection(Criteria
The criteria
subcriteria
,
String
The property path to resolve or projection alias
propertyName
)

Implements org.hibernate.criterion.CriteriaQuery.getTypeUsingProjection.

Get the type of a property path.
public String
private String
public String
public boolean
public boolean
public boolean
isJoin(String path)

public void
setAssociations(Set<String> associations)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasCriteriaMapback to summary
private final Map<String, Criteria> aliasCriteriaMap
associationPathCriteriaMapback to summary
private final Map<String, Criteria> associationPathCriteriaMap
associationPathJoinTypesMapback to summary
private final Map<String, JoinType> associationPathJoinTypesMap
associationsback to summary
private Set<String> associations
criteriaInfoMapback to summary
private final Map<Criteria, CriteriaInfoProvider> criteriaInfoMap
criteriaSQLAliasMapback to summary
private final Map<Criteria, String> criteriaSQLAliasMap
helperback to summary
private final SessionFactoryHelper helper
nameCriteriaInfoMapback to summary
private final Map<String, CriteriaInfoProvider> nameCriteriaInfoMap
outerQueryTranslatorback to summary
private CriteriaQuery outerQueryTranslator
ROOT_SQL_ALIASback to summary
public static final String ROOT_SQL_ALIAS
rootCriteriaback to summary
private final CriteriaImpl rootCriteria
rootEntityNameback to summary
private final String rootEntityName
rootSQLAliasback to summary
private final String rootSQLAlias
sessionFactoryback to summary
private final SessionFactoryImplementor sessionFactory

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

withClauseMapback to summary
private final Map<String, Criterion> withClauseMap

Constructor Detail

CriteriaQueryTranslatorback to summary
public CriteriaQueryTranslator(final SessionFactoryImplementor factory, final CriteriaImpl criteria, final String rootEntityName, final String rootSQLAlias, CriteriaQuery outerQuery) throws HibernateException

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

CriteriaQueryTranslatorback to summary
public CriteriaQueryTranslator(final SessionFactoryImplementor factory, final CriteriaImpl criteria, final String rootEntityName, final String rootSQLAlias) throws HibernateException

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Method Detail

addInnerJoinback to summary
private Criteria addInnerJoin(Criteria subcriteria, String root, CriteriaInfoProvider pathInfo)
createAliasCriteriaMapback to summary
private void createAliasCriteriaMap()
createAssociationPathCriteriaMapback to summary
private void createAssociationPathCriteriaMap()
createCriteriaEntityNameMapback to summary
private void createCriteriaEntityNameMap()
createCriteriaSQLAliasMapback to summary
private void createCriteriaSQLAliasMap()
findColumnsback to summary
public String[] findColumns(String propertyName, Criteria subcriteria) throws HibernateException

Implements org.hibernate.criterion.CriteriaQuery.findColumns.

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.

Parameters
propertyName:String

Doc from org.hibernate.criterion.CriteriaQuery.findColumns.

The property path to resolve

subcriteria:Criteria

Doc from org.hibernate.criterion.CriteriaQuery.findColumns.

The criteria

Returns:String[]

Doc from org.hibernate.criterion.CriteriaQuery.findColumns.

The column names

Annotations
@Override
Exceptions
HibernateException:

Doc from org.hibernate.criterion.CriteriaQuery.findColumns.

if the property could not be resolved

generateSQLAliasback to summary
public String generateSQLAlias()

Implements org.hibernate.criterion.CriteriaQuery.generateSQLAlias.

Doc from org.hibernate.criterion.CriteriaQuery.generateSQLAlias.

Generate a unique SQL alias

Returns:String

The generated alias

Annotations
@Override
getAliasedCriteriaback to summary
private Criteria getAliasedCriteria(String alias)
getColumnback to summary
public String getColumn(Criteria criteria, String propertyName)

Implements org.hibernate.criterion.CriteriaQuery.getColumn.

Doc from org.hibernate.criterion.CriteriaQuery.getColumn.

Resolve a property path to the name of the column it maps to. Ignores projection aliases.

Parameters
criteria:Criteria

The overall criteria

propertyName:String

The property path to resolve

Returns:String

The column name

Annotations
@Override
getColumnsback to summary
public String[] getColumns(String propertyName, Criteria subcriteria) throws HibernateException

Implements org.hibernate.criterion.CriteriaQuery.getColumns.

Doc from org.hibernate.criterion.CriteriaQuery.getColumns.

Resolve a property path to the names of the columns it maps to. Ignores projection aliases

Parameters
propertyName:String

The property path to resolve

subcriteria:Criteria

The criteria

Returns:String[]

The column names

Annotations
@Override
Exceptions
HibernateException:
if the property maps to more than 1 column, or if the property could not be resolved
getColumnsUsingProjectionback to summary
public String[] getColumnsUsingProjection(Criteria subcriteria, String propertyName) throws HibernateException

Implements org.hibernate.criterion.CriteriaQuery.getColumnsUsingProjection.

Get the names of the columns constrained by this criterion.

Parameters
subcriteria:Criteria

Doc from org.hibernate.criterion.CriteriaQuery.getColumnsUsingProjection.

The criteria

propertyName:String

Doc from org.hibernate.criterion.CriteriaQuery.getColumnsUsingProjection.

The property path to resolve or projection alias

Returns:String[]

Doc from org.hibernate.criterion.CriteriaQuery.getColumnsUsingProjection.

The column names

Annotations
@Override
Exceptions
HibernateException:

Doc from org.hibernate.criterion.CriteriaQuery.getColumnsUsingProjection.

if the property/alias could not be resolved

getCriteriaback to summary
public Criteria getCriteria(String path)
getEntityNameback to summary
public String getEntityName(Criteria criteria)

Implements org.hibernate.criterion.CriteriaQuery.getEntityName.

Doc from org.hibernate.criterion.CriteriaQuery.getEntityName.

Get the entity name of an entity

Parameters
criteria:Criteria

The criteria

Returns:String

The entity name

Annotations
@Override
getEntityNameback to summary
public String getEntityName(Criteria subcriteria, String propertyName)

Implements org.hibernate.criterion.CriteriaQuery.getEntityName.

Doc from org.hibernate.criterion.CriteriaQuery.getEntityName.

Get the entity name of an entity, taking into account the qualifier of the property path

Parameters
subcriteria:Criteria

The criteria

propertyName:String

The property path that (supposedly) references an entity

Returns:String

The entity name

Annotations
@Override
getFactoryback to summary
public SessionFactoryImplementor getFactory()

Implements org.hibernate.criterion.CriteriaQuery.getFactory.

Doc from org.hibernate.criterion.CriteriaQuery.getFactory.

Deprecated

as a consequence of SessionFactoryImplementor being deprecated. See corresponding docs for further information.

Provides access to the SessionFactory

Returns:SessionFactoryImplementor

The SessionFactory

Annotations
@Override
getForeignKeyColumnsback to summary
public String[] getForeignKeyColumns(Criteria criteria, String associationPropertyName)

Overrides default org.hibernate.criterion.CriteriaQuery.getForeignKeyColumns.

Annotations
@Override
getForeignKeyTypeback to summary
public Type getForeignKeyType(Criteria criteria, String associationPropertyName)

Overrides default org.hibernate.criterion.CriteriaQuery.getForeignKeyType.

Annotations
@Override
getForeignKeyTypeValueback to summary
public TypedValue getForeignKeyTypeValue(Criteria criteria, String associationPropertyName, Object value)

Overrides default org.hibernate.criterion.CriteriaQuery.getForeignKeyTypeValue.

Annotations
@Override
getGroupByback to summary
public String getGroupBy()
getIdentifierColumnsback to summary
public String[] getIdentifierColumns(Criteria criteria)

Implements org.hibernate.criterion.CriteriaQuery.getIdentifierColumns.

Doc from org.hibernate.criterion.CriteriaQuery.getIdentifierColumns.

Get the identifier column names of this entity

Parameters
criteria:Criteria

The criteria

Returns:String[]

The identifier column names

Annotations
@Override
getIdentifierTypeback to summary
public Type getIdentifierType(Criteria criteria)

Implements org.hibernate.criterion.CriteriaQuery.getIdentifierType.

Doc from org.hibernate.criterion.CriteriaQuery.getIdentifierType.

Get the identifier type of this entity

Parameters
criteria:Criteria

The criteria

Returns:Type

The identifier type.

Annotations
@Override
getJoinTypeback to summary
public JoinType getJoinType(String path)
getOrderByback to summary
public String getOrderBy()
getPathInfoback to summary
private CriteriaInfoProvider getPathInfo(String path)
getProjectedAliasesback to summary
public String[] getProjectedAliases()
getProjectedColumnAliasesback to summary
public String[] getProjectedColumnAliases()
getProjectedTypesback to summary
public Type[] getProjectedTypes()
getPropertyMappingback to summary
private PropertyMapping getPropertyMapping(String entityName) throws MappingException
getPropertyNameback to summary
public String getPropertyName(String propertyName)

Implements org.hibernate.criterion.CriteriaQuery.getPropertyName.

Doc from org.hibernate.criterion.CriteriaQuery.getPropertyName.

Get the property name, given a possibly qualified property name

Parameters
propertyName:String

The (possibly qualified) property name

Returns:String

The simple property name

Annotations
@Override
getQueryParametersback to summary
public QueryParameters getQueryParameters()
getQuerySpacesback to summary
public Set<Serializable> getQuerySpaces()
getResultTypeback to summary
pack-priv Type getResultType(Criteria criteria)
getRootCriteriaback to summary
public CriteriaImpl getRootCriteria()
getRootSQLALiasback to summary
public String getRootSQLALias()
getSelectback to summary
public String getSelect()
getSQLAliasback to summary
public String getSQLAlias(Criteria criteria)

Implements org.hibernate.criterion.CriteriaQuery.getSQLAlias.

Doc from org.hibernate.criterion.CriteriaQuery.getSQLAlias.

Get the root table alias of an entity

Parameters
criteria:Criteria

The criteria

Returns:String

The SQL table alias for the given criteria

Annotations
@Override
getSQLAliasback to summary
public String getSQLAlias(Criteria criteria, String propertyName)

Implements org.hibernate.criterion.CriteriaQuery.getSQLAlias.

Doc from org.hibernate.criterion.CriteriaQuery.getSQLAlias.

Get the root table alias of an entity, taking into account the qualifier of the property path

Parameters
criteria:Criteria

The criteria

propertyName:String

The property path whose SQL alias should be returned.

Returns:String

The SQL table alias for the given criteria

Annotations
@Override
getSQLAliasCountback to summary
public int getSQLAliasCount()
getTypeback to summary
public Type getType(Criteria subcriteria, String propertyName) throws HibernateException

Implements org.hibernate.criterion.CriteriaQuery.getType.

Doc from org.hibernate.criterion.CriteriaQuery.getType.

Get the type of a property path.

Parameters
subcriteria:Criteria

The criteria

propertyName:String

The property path to resolve

Returns:Type

The type

Annotations
@Override
Exceptions
HibernateException:
if the property could not be resolved
getTypedIdentifierValueback to summary
public TypedValue getTypedIdentifierValue(Criteria criteria, Object value)

Implements org.hibernate.criterion.CriteriaQuery.getTypedIdentifierValue.

Doc from org.hibernate.criterion.CriteriaQuery.getTypedIdentifierValue.

Build a TypedValue for the given identifier value.

Parameters
criteria:Criteria

The criteria whose identifier is referenced.

value:Object

The identifier value

Returns:TypedValue

The TypedValue

Annotations
@Override
getTypedValueback to summary
public TypedValue getTypedValue(Criteria subcriteria, String propertyName, Object value) throws HibernateException

Implements org.hibernate.criterion.CriteriaQuery.getTypedValue.

Get the typed value for the given property value.

Parameters
subcriteria:Criteria

Doc from org.hibernate.criterion.CriteriaQuery.getTypedValue.

The criteria query

propertyName:String

Doc from org.hibernate.criterion.CriteriaQuery.getTypedValue.

The property path/alias to resolve to type.

value:Object

Doc from org.hibernate.criterion.CriteriaQuery.getTypedValue.

The value

Returns:TypedValue

Doc from org.hibernate.criterion.CriteriaQuery.getTypedValue.

The TypedValue

Annotations
@Override
Exceptions
HibernateException:

Doc from org.hibernate.criterion.CriteriaQuery.getTypedValue.

if the property/alias could not be resolved

getTypeUsingProjectionback to summary
public Type getTypeUsingProjection(Criteria subcriteria, String propertyName) throws HibernateException

Implements org.hibernate.criterion.CriteriaQuery.getTypeUsingProjection.

Doc from org.hibernate.criterion.CriteriaQuery.getTypeUsingProjection.

Get the type of a property path. Here, the property path can refer to a projection alias.

Parameters
subcriteria:Criteria

The criteria

propertyName:String

The property path to resolve or projection alias

Returns:Type

The type

Annotations
@Override
Exceptions
HibernateException:
if the property/alias could not be resolved
getWhereConditionback to summary
public String getWhereCondition()
getWholeAssociationPathback to summary
private String getWholeAssociationPath(CriteriaImpl.Subcriteria subcriteria)
getWithClauseback to summary
public String getWithClause(String path)
hasProjectionback to summary
public boolean hasProjection()
hasRestrictionback to summary
public boolean hasRestriction(String path)
isJoinback to summary
public boolean isJoin(String path)
setAssociationsback to summary
public void setAssociations(Set<String> associations)