Class QueryJoinFragment


  • public class QueryJoinFragment
    extends JoinFragment
    A join that appears in a translated HQL query
    • Constructor Detail

      • QueryJoinFragment

        public QueryJoinFragment​(Dialect dialect,
                                 boolean useThetaStyleInnerJoins)
    • Method Detail

      • addJoin

        public void addJoin​(String tableName,
                            String alias,
                            String[] fkColumns,
                            String[] pkColumns,
                            JoinType joinType)
        Description copied from class: JoinFragment
        Adds a join.
        Specified by:
        addJoin in class JoinFragment
        Parameters:
        tableName - The name of the table to be joined
        alias - The alias to apply to the joined table
        fkColumns - The names of the columns which reference the joined table
        pkColumns - The columns in the joined table being referenced
        joinType - The type of join
      • addJoin

        public void addJoin​(String tableName,
                            String alias,
                            String[] fkColumns,
                            String[] pkColumns,
                            JoinType joinType,
                            String on)
        Description copied from class: JoinFragment
        Adds a join, with an additional ON clause fragment
        Specified by:
        addJoin in class JoinFragment
        Parameters:
        tableName - The name of the table to be joined
        alias - The alias to apply to the joined table
        fkColumns - The names of the columns which reference the joined table
        pkColumns - The columns in the joined table being referenced
        joinType - The type of join
        on - The additional ON fragment
      • addJoin

        public void addJoin​(String tableName,
                            String alias,
                            String[][] fkColumns,
                            String[] pkColumns,
                            JoinType joinType,
                            String on)
        Description copied from class: JoinFragment
        Adds a join, with an additional ON clause fragment
        Overrides:
        addJoin in class JoinFragment
        Parameters:
        tableName - The name of the table to be joined
        alias - The alias to apply to the joined table
        fkColumns - The names of the columns which reference the joined table
        pkColumns - The columns in the joined table being referenced
        joinType - The type of join
        on - The additional ON fragment
      • toFromFragmentString

        public String toFromFragmentString()
        Description copied from class: JoinFragment
        Render this fragment to its FROM clause portion
        Specified by:
        toFromFragmentString in class JoinFragment
        Returns:
        The FROM clause portion of this fragment
      • toWhereFragmentString

        public String toWhereFragmentString()
        Description copied from class: JoinFragment
        Render this fragment to its WHERE clause portion
        Specified by:
        toWhereFragmentString in class JoinFragment
        Returns:
        The WHERE clause portion of this fragment
      • addJoins

        public void addJoins​(String fromFragment,
                             String whereFragment)
        Description copied from class: JoinFragment
        Free-form form of adding theta-style joins taking the necessary FROM and WHERE clause fragments
        Specified by:
        addJoins in class JoinFragment
        Parameters:
        fromFragment - The FROM clause fragment
        whereFragment - The WHERE clause fragment
      • addCondition

        public void addCondition​(String alias,
                                 String[] columns,
                                 String condition)
      • addCrossJoin

        public void addCrossJoin​(String tableName,
                                 String alias)
        Description copied from class: JoinFragment
        Adds a cross join to the specified table.
        Specified by:
        addCrossJoin in class JoinFragment
        Parameters:
        tableName - The name of the table to be joined
        alias - The alias to apply to the joined table
      • addCondition

        public void addCondition​(String alias,
                                 String[] fkColumns,
                                 String[] pkColumns)
        Description copied from class: JoinFragment
        Adds a condition to the join fragment.
        Specified by:
        addCondition in class JoinFragment
        Parameters:
        alias - The alias of the joined table
        fkColumns - The names of the columns which reference the joined table
        pkColumns - The columns in the joined table being referenced
      • addCondition

        public void addCondition​(String alias,
                                 String[][] fkColumns,
                                 String[] pkColumns)
      • addCondition

        public boolean addCondition​(String condition)
        Add the condition string to the join fragment.
        Specified by:
        addCondition in class JoinFragment
        Parameters:
        condition -
        Returns:
        true if the condition was added, false if it was already in the fragment.
      • addFromFragmentString

        public void addFromFragmentString​(String fromFragmentString)
      • clearWherePart

        public void clearWherePart()