Class JoinFragment

    • Constructor Summary

      Constructors 
      Constructor Description
      JoinFragment()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract boolean addCondition​(java.lang.String condition)
      Adds a free-form condition fragment
      protected boolean addCondition​(java.lang.StringBuilder buffer, java.lang.String on)
      Appends the 'on' condition to the buffer, returning true if the condition was added.
      abstract void addCondition​(java.lang.String alias, java.lang.String[] fkColumns, java.lang.String[] pkColumns)
      Adds a condition to the join fragment.
      abstract void addCrossJoin​(java.lang.String tableName, java.lang.String alias)
      Adds a cross join to the specified table.
      void addFragment​(JoinFragment ojf)
      Adds another join fragment to this one.
      void addJoin​(java.lang.String tableName, java.lang.String alias, java.lang.String[][] fkColumns, java.lang.String[] pkColumns, JoinType joinType, java.lang.String on)
      Adds a join, with an additional ON clause fragment
      abstract void addJoin​(java.lang.String tableName, java.lang.String alias, java.lang.String[] fkColumns, java.lang.String[] pkColumns, JoinType joinType)
      Adds a join.
      abstract void addJoin​(java.lang.String tableName, java.lang.String alias, java.lang.String[] fkColumns, java.lang.String[] pkColumns, JoinType joinType, java.lang.String on)
      Adds a join, with an additional ON clause fragment
      abstract void addJoins​(java.lang.String fromFragment, java.lang.String whereFragment)
      Free-form form of adding theta-style joins taking the necessary FROM and WHERE clause fragments
      abstract JoinFragment copy()
      Make a copy.
      boolean hasFilterCondition()
      True if the where fragment is from a filter condition.
      boolean hasThetaJoins()
      Determine if the join fragment contained any theta-joins.
      void setHasFilterCondition​(boolean b)  
      void setHasThetaJoins​(boolean hasThetaJoins)  
      abstract java.lang.String toFromFragmentString()
      Render this fragment to its FROM clause portion
      abstract java.lang.String toWhereFragmentString()
      Render this fragment to its WHERE clause portion
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INNER_JOIN

        @Deprecated
        public static final int INNER_JOIN
        Deprecated.
        use JoinType.INNER_JOIN instead.
        Specifies an inner join.
      • FULL_JOIN

        @Deprecated
        public static final int FULL_JOIN
        Deprecated.
        use JoinType.FULL_JOIN instead.
        Specifies a full join
      • LEFT_OUTER_JOIN

        @Deprecated
        public static final int LEFT_OUTER_JOIN
        Deprecated.
        Specifies a left join.
      • RIGHT_OUTER_JOIN

        @Deprecated
        public static final int RIGHT_OUTER_JOIN
        Deprecated.
        Specifies a right join.
    • Constructor Detail

      • JoinFragment

        public JoinFragment()
    • Method Detail

      • addJoin

        public abstract void addJoin​(java.lang.String tableName,
                                     java.lang.String alias,
                                     java.lang.String[] fkColumns,
                                     java.lang.String[] pkColumns,
                                     JoinType joinType)
        Adds a join.
        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 abstract void addJoin​(java.lang.String tableName,
                                     java.lang.String alias,
                                     java.lang.String[] fkColumns,
                                     java.lang.String[] pkColumns,
                                     JoinType joinType,
                                     java.lang.String on)
        Adds a join, with an additional ON clause fragment
        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​(java.lang.String tableName,
                            java.lang.String alias,
                            java.lang.String[][] fkColumns,
                            java.lang.String[] pkColumns,
                            JoinType joinType,
                            java.lang.String on)
        Adds a join, with an additional ON clause fragment
        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
      • addCrossJoin

        public abstract void addCrossJoin​(java.lang.String tableName,
                                          java.lang.String alias)
        Adds a cross join to the specified table.
        Parameters:
        tableName - The name of the table to be joined
        alias - The alias to apply to the joined table
      • addJoins

        public abstract void addJoins​(java.lang.String fromFragment,
                                      java.lang.String whereFragment)
        Free-form form of adding theta-style joins taking the necessary FROM and WHERE clause fragments
        Parameters:
        fromFragment - The FROM clause fragment
        whereFragment - The WHERE clause fragment
      • toFromFragmentString

        public abstract java.lang.String toFromFragmentString()
        Render this fragment to its FROM clause portion
        Returns:
        The FROM clause portion of this fragment
      • toWhereFragmentString

        public abstract java.lang.String toWhereFragmentString()
        Render this fragment to its WHERE clause portion
        Returns:
        The WHERE clause portion of this fragment
      • addCondition

        public abstract void addCondition​(java.lang.String alias,
                                          java.lang.String[] fkColumns,
                                          java.lang.String[] pkColumns)
        Adds a condition to the join fragment.
        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 abstract boolean addCondition​(java.lang.String condition)
        Adds a free-form condition fragment
        Parameters:
        condition - The fragment
        Returns:
        true if the condition was added
      • copy

        public abstract JoinFragment copy()
        Make a copy.
        Returns:
        The copy.
      • addFragment

        public void addFragment​(JoinFragment ojf)
        Adds another join fragment to this one.
        Parameters:
        ojf - The other join fragment
      • addCondition

        protected boolean addCondition​(java.lang.StringBuilder buffer,
                                       java.lang.String on)
        Appends the 'on' condition to the buffer, returning true if the condition was added. Returns false if the 'on' condition was empty.
        Parameters:
        buffer - The buffer to append the 'on' condition to.
        on - The 'on' condition.
        Returns:
        Returns true if the condition was added, false if the condition was already in 'on' string.
      • hasFilterCondition

        public boolean hasFilterCondition()
        True if the where fragment is from a filter condition.
        Returns:
        True if the where fragment is from a filter condition.
      • setHasFilterCondition

        public void setHasFilterCondition​(boolean b)
      • hasThetaJoins

        public boolean hasThetaJoins()
        Determine if the join fragment contained any theta-joins.
        Returns:
        true if the fragment contained theta joins
      • setHasThetaJoins

        public void setHasThetaJoins​(boolean hasThetaJoins)