Package org.hibernate.loader.criteria
Class CriteriaJoinWalker
- java.lang.Object
-
- org.hibernate.loader.JoinWalker
-
- org.hibernate.loader.AbstractEntityJoinWalker
-
- org.hibernate.loader.criteria.CriteriaJoinWalker
-
public class CriteriaJoinWalker extends AbstractEntityJoinWalker
A JoinWalker for Criteria queries.- See Also:
CriteriaLoader
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.loader.JoinWalker
JoinWalker.AssociationInitCallback
-
-
Field Summary
-
Fields inherited from class org.hibernate.loader.JoinWalker
aliases, associations, collectionOwners, collectionPersisters, collectionSuffixes, lockModeArray, lockOptions, ownerAssociationTypes, owners, persisters, sql, suffixes
-
-
Constructor Summary
Constructors Constructor Description CriteriaJoinWalker(OuterJoinLoadable persister, CriteriaQueryTranslator translator, SessionFactoryImplementor factory, org.hibernate.internal.CriteriaImpl criteria, java.lang.String rootEntityName, LoadQueryInfluencers loadQueryInfluencers)
CriteriaJoinWalker(OuterJoinLoadable persister, CriteriaQueryTranslator translator, SessionFactoryImplementor factory, org.hibernate.internal.CriteriaImpl criteria, java.lang.String rootEntityName, LoadQueryInfluencers loadQueryInfluencers, java.lang.String alias)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.String
generateRootAlias(java.lang.String tableName)
protected java.lang.String
generateTableAlias(int n, PropertyPath path, Joinable joinable)
java.lang.String
getComment()
protected JoinType
getJoinType(OuterJoinLoadable persister, PropertyPath path, int propertyNumber, AssociationType associationType, FetchMode metadataFetchMode, CascadeStyle metadataCascadeStyle, java.lang.String lhsTable, java.lang.String[] lhsColumns, boolean nullable, int currentDepth)
Determine the appropriate type of join (if any) to use to fetch the given association.protected JoinType
getJoinType(AssociationType associationType, FetchMode config, PropertyPath path, java.lang.String lhsTable, java.lang.String[] lhsColumns, boolean nullable, int currentDepth, CascadeStyle cascadeStyle)
Determine the appropriate associationType of join (if any) to use to fetch the given association.java.util.Set
getQuerySpaces()
Type[]
getResultTypes()
java.lang.String[]
getUserAliases()
protected java.lang.String
getWhereFragment()
Use the discriminator, to narrow the select to instances of the queried subclass, also applying any filters.protected java.lang.String
getWithClause(PropertyPath path)
protected boolean
hasRestriction(PropertyPath path)
boolean[]
includeInResultRow()
-
Methods inherited from class org.hibernate.loader.AbstractEntityJoinWalker
getAlias, getPersister, initAll, initAll, initProjection, isDuplicateAssociation, isJoinedFetchEnabled, isJoinFetchEnabledByProfile, orderBy, toString
-
Methods inherited from class org.hibernate.loader.JoinWalker
countCollectionPersisters, countEntityPersisters, getAliases, getAssociations, getCollectionOwners, getCollectionPersisters, getCollectionSuffixes, getDialect, getFactory, getJoinType, getLoadQueryInfluencers, getLockModeArray, getLockModeOptions, getOwnerAssociationTypes, getOwners, getPersisters, getSQLString, getSuffixes, initPersisters, initPersisters, initPersisters, isDuplicateAssociation, isJoinable, isJoinedFetchEnabledInMapping, isTooDeep, isTooManyCollections, mergeOrderings, mergeOuterJoins, orderBy, selectString, setAliases, setCollectionOwners, setCollectionPersisters, setCollectionSuffixes, setOwnerAssociationTypes, setOwners, setPersisters, setSql, setSuffixes, walkCollectionTree, walkEntityTree, whereString, whereString
-
-
-
-
Constructor Detail
-
CriteriaJoinWalker
public CriteriaJoinWalker(OuterJoinLoadable persister, CriteriaQueryTranslator translator, SessionFactoryImplementor factory, org.hibernate.internal.CriteriaImpl criteria, java.lang.String rootEntityName, LoadQueryInfluencers loadQueryInfluencers)
-
CriteriaJoinWalker
public CriteriaJoinWalker(OuterJoinLoadable persister, CriteriaQueryTranslator translator, SessionFactoryImplementor factory, org.hibernate.internal.CriteriaImpl criteria, java.lang.String rootEntityName, LoadQueryInfluencers loadQueryInfluencers, java.lang.String alias)
-
-
Method Detail
-
getResultTypes
public Type[] getResultTypes()
-
getUserAliases
public java.lang.String[] getUserAliases()
-
includeInResultRow
public boolean[] includeInResultRow()
-
getJoinType
protected JoinType getJoinType(OuterJoinLoadable persister, PropertyPath path, int propertyNumber, AssociationType associationType, FetchMode metadataFetchMode, CascadeStyle metadataCascadeStyle, java.lang.String lhsTable, java.lang.String[] lhsColumns, boolean nullable, int currentDepth) throws MappingException
Description copied from class:JoinWalker
Determine the appropriate type of join (if any) to use to fetch the given association.- Overrides:
getJoinType
in classJoinWalker
- Parameters:
persister
- The owner of the association.path
- The path to the associationpropertyNumber
- The property number representing the association.associationType
- The association type.metadataFetchMode
- The metadata-defined fetch mode.metadataCascadeStyle
- The metadata-defined cascade style.lhsTable
- The owner tablelhsColumns
- The owner join columnsnullable
- Is the association nullable.currentDepth
- Current join depth- Returns:
- type of join to use (
JoinType.INNER_JOIN
,JoinType.LEFT_OUTER_JOIN
, or -1 to indicate no joining. - Throws:
MappingException
- ??
-
getJoinType
protected JoinType getJoinType(AssociationType associationType, FetchMode config, PropertyPath path, java.lang.String lhsTable, java.lang.String[] lhsColumns, boolean nullable, int currentDepth, CascadeStyle cascadeStyle) throws MappingException
Description copied from class:JoinWalker
Determine the appropriate associationType of join (if any) to use to fetch the given association.- Overrides:
getJoinType
in classJoinWalker
- Parameters:
associationType
- The association associationType.config
- The metadata-defined fetch mode.path
- The path to the associationlhsTable
- The owner tablelhsColumns
- The owner join columnsnullable
- Is the association nullable.currentDepth
- Current join depthcascadeStyle
- The metadata-defined cascade style.- Returns:
- type of join to use (
JoinType.INNER_JOIN
,JoinType.LEFT_OUTER_JOIN
, or -1 to indicate no joining. - Throws:
MappingException
- ??
-
getWhereFragment
protected java.lang.String getWhereFragment() throws MappingException
Use the discriminator, to narrow the select to instances of the queried subclass, also applying any filters.- Overrides:
getWhereFragment
in classAbstractEntityJoinWalker
- Throws:
MappingException
-
generateTableAlias
protected java.lang.String generateTableAlias(int n, PropertyPath path, Joinable joinable)
- Overrides:
generateTableAlias
in classJoinWalker
-
generateRootAlias
protected java.lang.String generateRootAlias(java.lang.String tableName)
- Overrides:
generateRootAlias
in classJoinWalker
-
getQuerySpaces
public java.util.Set getQuerySpaces()
-
getComment
public java.lang.String getComment()
- Specified by:
getComment
in classAbstractEntityJoinWalker
-
getWithClause
protected java.lang.String getWithClause(PropertyPath path)
- Overrides:
getWithClause
in classJoinWalker
-
hasRestriction
protected boolean hasRestriction(PropertyPath path)
- Overrides:
hasRestriction
in classJoinWalker
-
-