Class JoinHelper


  • public final class JoinHelper
    extends Object
    Helper for dealing with joins.
    • Method Detail

      • getLHSColumnNames

        public static String[] getLHSColumnNames​(AssociationType type,
                                                 int property,
                                                 OuterJoinLoadable lhsPersister,
                                                 Mapping mapping)
        Get the unqualified names of the columns of the owning entity which are to be used in the join.
        Parameters:
        type - The association type for the association that represents the join
        property - The name of the property that represents the association/join
        lhsPersister - The persister for the left-hand side of the association/join
        mapping - The mapping (typically the SessionFactory).
        Returns:
        The unqualified column names.
      • getLHSColumnNames

        public static String[] getLHSColumnNames​(AssociationType type,
                                                 int property,
                                                 int begin,
                                                 OuterJoinLoadable lhsPersister,
                                                 Mapping mapping)
        Get the columns of the owning entity which are to be used in the join
        Parameters:
        type - The type representing the join
        property - The property index for the association type
        begin - ?
        lhsPersister - The persister for the left-hand-side of the join
        mapping - The mapping object (typically the SessionFactory)
        Returns:
        The columns for the left-hand-side of the join
      • getLHSTableName

        public static String getLHSTableName​(AssociationType type,
                                             int propertyIndex,
                                             OuterJoinLoadable lhsPersister)
        Determine the name of the table that is the left-hand-side of the join. Usually this is the name of the main table from the left-hand-side persister. But that is not the case with property-refs.
        Parameters:
        type - The type representing the join
        propertyIndex - The property index for the type
        lhsPersister - The persister for the left-hand-side of the join
        Returns:
        The table name
      • getRHSColumnNames

        public static String[] getRHSColumnNames​(AssociationType type,
                                                 SessionFactoryImplementor factory)
        Get the columns of the associated table which are to be used in the join
        Parameters:
        type - The type
        factory - The SessionFactory
        Returns:
        The columns for the right-hand-side of the join