org.hibernate.loader.criteria
Class CriteriaJoinWalker

java.lang.Object
  extended by org.hibernate.loader.JoinWalker
      extended by org.hibernate.loader.AbstractEntityJoinWalker
          extended by 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
CriteriaJoinWalker(OuterJoinLoadable persister, CriteriaQueryTranslator translator, SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, LoadQueryInfluencers loadQueryInfluencers)
           
CriteriaJoinWalker(OuterJoinLoadable persister, CriteriaQueryTranslator translator, SessionFactoryImplementor factory, CriteriaImpl criteria, String rootEntityName, LoadQueryInfluencers loadQueryInfluencers, String alias)
           
 
Method Summary
protected  String generateRootAlias(String tableName)
           
protected  String generateTableAlias(int n, PropertyPath path, Joinable joinable)
           
 String getComment()
           
protected  JoinType getJoinType(AssociationType associationType, FetchMode config, PropertyPath path, String lhsTable, String[] lhsColumns, boolean nullable, int currentDepth, CascadeStyle cascadeStyle)
          Determine the appropriate associationType of join (if any) to use to fetch the given association.
protected  JoinType getJoinType(OuterJoinLoadable persister, PropertyPath path, int propertyNumber, AssociationType associationType, FetchMode metadataFetchMode, CascadeStyle metadataCascadeStyle, String lhsTable, String[] lhsColumns, boolean nullable, int currentDepth)
          Determine the appropriate type of join (if any) to use to fetch the given association.
 Set getQuerySpaces()
           
 Type[] getResultTypes()
           
 String[] getUserAliases()
           
protected  String getWhereFragment()
          Use the discriminator, to narrow the select to instances of the queried subclass, also applying any filters.
protected  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, toString
 
Methods inherited from class org.hibernate.loader.JoinWalker
countCollectionPersisters, countEntityPersisters, getAliases, 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, orderBy, selectString, setAliases, setCollectionOwners, setCollectionPersisters, setCollectionSuffixes, setOwnerAssociationTypes, setOwners, setPersisters, setSql, setSuffixes, walkCollectionTree, walkEntityTree, whereString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CriteriaJoinWalker

public CriteriaJoinWalker(OuterJoinLoadable persister,
                          CriteriaQueryTranslator translator,
                          SessionFactoryImplementor factory,
                          CriteriaImpl criteria,
                          String rootEntityName,
                          LoadQueryInfluencers loadQueryInfluencers)

CriteriaJoinWalker

public CriteriaJoinWalker(OuterJoinLoadable persister,
                          CriteriaQueryTranslator translator,
                          SessionFactoryImplementor factory,
                          CriteriaImpl criteria,
                          String rootEntityName,
                          LoadQueryInfluencers loadQueryInfluencers,
                          String alias)
Method Detail

getResultTypes

public Type[] getResultTypes()

getUserAliases

public String[] getUserAliases()

includeInResultRow

public boolean[] includeInResultRow()

getJoinType

protected JoinType getJoinType(OuterJoinLoadable persister,
                               PropertyPath path,
                               int propertyNumber,
                               AssociationType associationType,
                               FetchMode metadataFetchMode,
                               CascadeStyle metadataCascadeStyle,
                               String lhsTable,
                               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 class JoinWalker
Parameters:
persister - The owner of the association.
path - The path to the association
propertyNumber - 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 table
lhsColumns - The owner join columns
nullable - 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,
                               String lhsTable,
                               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 class JoinWalker
Parameters:
associationType - The association associationType.
config - The metadata-defined fetch mode.
path - The path to the association
lhsTable - The owner table
lhsColumns - The owner join columns
nullable - Is the association nullable.
currentDepth - Current join depth
cascadeStyle - 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 String getWhereFragment()
                           throws MappingException
Use the discriminator, to narrow the select to instances of the queried subclass, also applying any filters.

Overrides:
getWhereFragment in class AbstractEntityJoinWalker
Throws:
MappingException

generateTableAlias

protected String generateTableAlias(int n,
                                    PropertyPath path,
                                    Joinable joinable)
Overrides:
generateTableAlias in class JoinWalker

generateRootAlias

protected String generateRootAlias(String tableName)
Overrides:
generateRootAlias in class JoinWalker

getQuerySpaces

public Set getQuerySpaces()

getComment

public String getComment()
Specified by:
getComment in class AbstractEntityJoinWalker

getWithClause

protected String getWithClause(PropertyPath path)
Overrides:
getWithClause in class JoinWalker

hasRestriction

protected boolean hasRestriction(PropertyPath path)
Overrides:
hasRestriction in class JoinWalker


Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.