Class JoinWalker

    • Field Detail

      • associations

        protected final List associations
      • suffixes

        protected String[] suffixes
      • collectionSuffixes

        protected String[] collectionSuffixes
      • persisters

        protected Loadable[] persisters
      • owners

        protected int[] owners
      • ownerAssociationTypes

        protected EntityType[] ownerAssociationTypes
      • collectionOwners

        protected int[] collectionOwners
      • aliases

        protected String[] aliases
      • lockModeArray

        protected LockMode[] lockModeArray
    • Method Detail

      • getAssociations

        public List getAssociations()
      • getCollectionSuffixes

        public String[] getCollectionSuffixes()
      • setCollectionSuffixes

        public void setCollectionSuffixes​(String[] collectionSuffixes)
      • getLockModeOptions

        public LockOptions getLockModeOptions()
      • getLockModeArray

        public LockMode[] getLockModeArray()
      • getSuffixes

        public String[] getSuffixes()
      • setSuffixes

        public void setSuffixes​(String[] suffixes)
      • getAliases

        public String[] getAliases()
      • setAliases

        public void setAliases​(String[] aliases)
      • getCollectionOwners

        public int[] getCollectionOwners()
      • setCollectionOwners

        public void setCollectionOwners​(int[] collectionOwners)
      • setCollectionPersisters

        public void setCollectionPersisters​(CollectionPersister[] collectionPersisters)
      • getOwnerAssociationTypes

        public EntityType[] getOwnerAssociationTypes()
      • setOwnerAssociationTypes

        public void setOwnerAssociationTypes​(EntityType[] ownerAssociationType)
      • getOwners

        public int[] getOwners()
      • setOwners

        public void setOwners​(int[] owners)
      • getPersisters

        public Loadable[] getPersisters()
      • setPersisters

        public void setPersisters​(Loadable[] persisters)
      • getSQLString

        public String getSQLString()
      • setSql

        public void setSql​(String sql)
      • getDialect

        protected Dialect getDialect()
      • hasRestriction

        protected boolean hasRestriction​(PropertyPath path)
      • 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
        Determine the appropriate type of join (if any) to use to fetch the given association.
        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
        Determine the appropriate associationType of join (if any) to use to fetch the given association.
        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 - ??
      • getJoinType

        protected JoinType getJoinType​(boolean nullable,
                                       int currentDepth)
        Use an inner join if it is a non-null association and this is the "first" join in a series
      • isTooDeep

        protected boolean isTooDeep​(int currentDepth)
      • isTooManyCollections

        protected boolean isTooManyCollections()
      • isJoinedFetchEnabledInMapping

        protected boolean isJoinedFetchEnabledInMapping​(FetchMode config,
                                                        AssociationType type)
                                                 throws MappingException
        Does the mapping, and Hibernate default semantics, specify that this association should be fetched by outer joining
        Throws:
        MappingException
      • isJoinedFetchEnabled

        protected boolean isJoinedFetchEnabled​(AssociationType type,
                                               FetchMode config,
                                               CascadeStyle cascadeStyle)
        Override on subclasses to enable or suppress joining of certain association types
      • generateRootAlias

        protected String generateRootAlias​(String description)
      • isDuplicateAssociation

        protected boolean isDuplicateAssociation​(String foreignKeyTable,
                                                 String[] foreignKeyColumns)
        Used to detect circularities in the joined graph, note that this method is side-effecty
      • isDuplicateAssociation

        protected boolean isDuplicateAssociation​(String lhsTable,
                                                 String[] lhsColumnNames,
                                                 AssociationType type)
        Used to detect circularities in the joined graph, note that this method is side-effecty
      • isJoinable

        protected boolean isJoinable​(JoinType joinType,
                                     Set visitedAssociationKeys,
                                     String lhsTable,
                                     String[] lhsColumnNames,
                                     AssociationType type,
                                     int depth)
        Should we join this association?
      • mergeOrderings

        protected static String mergeOrderings​(String ordering1,
                                               String ordering2)
      • countEntityPersisters

        protected static int countEntityPersisters​(List associations)
                                            throws MappingException
        Count the number of instances of Joinable which are actually also instances of Loadable, or are one-to-many associations
        Throws:
        MappingException
      • countCollectionPersisters

        protected static int countCollectionPersisters​(List associations)
                                                throws MappingException
        Count the number of instances of Joinable which are actually also instances of PersistentCollection which are being fetched by outer join
        Throws:
        MappingException
      • whereString

        protected StringBuilder whereString​(String alias,
                                            String[] columnNames,
                                            int batchSize)
        Render the where condition for a (batch) load by identifier / collection key