类 JoinHelper


  • public final class JoinHelper
    extends Object
    Helper for dealing with joins.
    作者:
    Gavin King
    • 方法详细资料

      • getAliasedLHSColumnNames

        public static String[] getAliasedLHSColumnNames​(AssociationType type,
                                                        String alias,
                                                        int property,
                                                        OuterJoinLoadable lhsPersister,
                                                        Mapping mapping)
        Get the qualified (prefixed by alias) names of the columns of the owning entity which are to be used in the join
        参数:
        type - The association type for the association that represents the join
        alias - The left-hand side table alias
        property - The index 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).
        返回:
        The qualified column names.
      • 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.
        参数:
        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).
        返回:
        The unqualified column names.
      • getAliasedLHSColumnNames

        public static String[] getAliasedLHSColumnNames​(AssociationType associationType,
                                                        String columnQualifier,
                                                        int propertyIndex,
                                                        int begin,
                                                        OuterJoinLoadable lhsPersister,
                                                        Mapping mapping)
        Get the qualified (prefixed by alias) names of the columns of the owning entity which are to be used in the join
        参数:
        associationType - The association type for the association that represents the join
        columnQualifier - The left-hand side table alias
        propertyIndex - The index of the property that represents the association/join
        begin - The index for any nested (composites) attributes
        lhsPersister - The persister for the left-hand side of the association/join
        mapping - The mapping (typically the SessionFactory).
        返回:
        The qualified 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
        参数:
        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)
        返回:
        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.
        参数:
        type - The type representing the join
        propertyIndex - The property index for the type
        lhsPersister - The persister for the left-hand-side of the join
        返回:
        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
        参数:
        type - The type
        factory - The SessionFactory
        返回:
        The columns for the right-hand-side of the join