org.hibernate.loader.criteria

Class CriteriaQueryTranslator

Implemented Interfaces:
CriteriaQuery

public class CriteriaQueryTranslator
extends java.lang.Object
implements CriteriaQuery

Author:
Gavin King

Field Summary

static String
ROOT_SQL_ALIAS

Constructor Summary

CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias)
CriteriaQueryTranslator(SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, String rootSQLAlias, CriteriaQuery outerQuery)

Method Summary

String
generateSQLAlias()
String
getColumn(Criteria criteria, String propertyName)
Get the names of the columns mapped by a property path, ignoring projection aliases
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()
String
getGroupBy()
String[]
getIdentifierColumns(Criteria subcriteria)
Get the identifier column names of this entity
Type
getIdentifierType(Criteria subcriteria)
Get the identifier type of this entity
int
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
getQuerySpaces()
CriteriaImpl
getRootCriteria()
String
getRootSQLALias()
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()
String
getSelect()
Type
getType(Criteria subcriteria, String propertyName)
Get the type of a property path, ignoring projection aliases
Type
getTypeUsingProjection(Criteria subcriteria, String propertyName)
Get the type of a property path
TypedValue
getTypedIdentifierValue(Criteria subcriteria, Object value)
TypedValue
getTypedValue(Criteria subcriteria, String propertyName, Object value)
Get the a typed value for the given property value.
String
getWhereCondition()
boolean
hasProjection()
boolean
isJoin(String path)

Field Details

ROOT_SQL_ALIAS

public static final String ROOT_SQL_ALIAS

Constructor Details

CriteriaQueryTranslator

public CriteriaQueryTranslator(SessionFactoryImplementor factory,
                               CriteriaImpl criteria,
                               String rootEntityName,
                               String rootSQLAlias)
            throws HibernateException

CriteriaQueryTranslator

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

Method Details

generateSQLAlias

public String generateSQLAlias()
Specified by:
generateSQLAlias in interface CriteriaQuery

getColumn

public String getColumn(Criteria criteria,
                        String propertyName)
Get the names of the columns mapped by a property path, ignoring projection aliases
Specified by:
getColumn in interface CriteriaQuery

getColumnsUsingProjection

public String[] getColumnsUsingProjection(Criteria subcriteria,
                                          String propertyName)
            throws HibernateException
Get the names of the columns constrained by this criterion.
Specified by:
getColumnsUsingProjection in interface CriteriaQuery

getCriteria

public Criteria getCriteria(String path)

getEntityName

public String getEntityName(Criteria criteria)
Get the entity name of an entity
Specified by:
getEntityName in interface CriteriaQuery

getEntityName

public String getEntityName(Criteria subcriteria,
                            String propertyName)
Get the entity name of an entity, taking into account the qualifier of the property path
Specified by:
getEntityName in interface CriteriaQuery

getFactory

public SessionFactoryImplementor getFactory()
Specified by:
getFactory in interface CriteriaQuery

getGroupBy

public String getGroupBy()

getIdentifierColumns

public String[] getIdentifierColumns(Criteria subcriteria)
Get the identifier column names of this entity
Specified by:
getIdentifierColumns in interface CriteriaQuery

getIdentifierType

public Type getIdentifierType(Criteria subcriteria)
Get the identifier type of this entity
Specified by:
getIdentifierType in interface CriteriaQuery

getJoinType

public int getJoinType(String path)

getOrderBy

public String getOrderBy()

getProjectedAliases

public String[] getProjectedAliases()

getProjectedColumnAliases

public String[] getProjectedColumnAliases()

getProjectedTypes

public Type[] getProjectedTypes()

getPropertyName

public String getPropertyName(String propertyName)
Get the property name, given a possibly qualified property name
Specified by:
getPropertyName in interface CriteriaQuery

getQueryParameters

public QueryParameters getQueryParameters()

getQuerySpaces

public Set getQuerySpaces()

getRootCriteria

public CriteriaImpl getRootCriteria()

getRootSQLALias

public String getRootSQLALias()

getSQLAlias

public String getSQLAlias(Criteria criteria)
Get the root table alias of an entity
Specified by:
getSQLAlias in interface CriteriaQuery

getSQLAlias

public String getSQLAlias(Criteria criteria,
                          String propertyName)
Get the root table alias of an entity, taking into account the qualifier of the property path
Specified by:
getSQLAlias in interface CriteriaQuery

getSQLAliasCount

public int getSQLAliasCount()

getSelect

public String getSelect()

getType

public Type getType(Criteria subcriteria,
                    String propertyName)
            throws HibernateException
Get the type of a property path, ignoring projection aliases
Specified by:
getType in interface CriteriaQuery

getTypeUsingProjection

public Type getTypeUsingProjection(Criteria subcriteria,
                                   String propertyName)
            throws HibernateException
Get the type of a property path
Specified by:
getTypeUsingProjection in interface CriteriaQuery

getTypedIdentifierValue

public TypedValue getTypedIdentifierValue(Criteria subcriteria,
                                          Object value)
Specified by:
getTypedIdentifierValue in interface CriteriaQuery

getTypedValue

public TypedValue getTypedValue(Criteria subcriteria,
                                String propertyName,
                                Object value)
            throws HibernateException
Get the a typed value for the given property value.
Specified by:
getTypedValue in interface CriteriaQuery

getWhereCondition

public String getWhereCondition()

hasProjection

public boolean hasProjection()

isJoin

public boolean isJoin(String path)