Class JoinType

  • All Implemented Interfaces:
    Cloneable, LanguageObject

    public class JoinType
    extends Object
    implements LanguageObject
    This class represents a join type. Outer joins will put nulls on the outer side for non-matches. "Cross" joins have no criteria and are a cross product of all rows in each table. To use a JoinType, you should not (and cannot) construct the object - rather you should use the provided static constants.
    • Field Detail

      • JOIN_INNER

        public static final JoinType JOIN_INNER
        Represents an inner join: a INNER JOIN b
      • JOIN_RIGHT_OUTER

        public static final JoinType JOIN_RIGHT_OUTER
        Represents a right outer join: a RIGHT OUTER JOIN b
      • JOIN_LEFT_OUTER

        public static final JoinType JOIN_LEFT_OUTER
        Represents a left outer join: a LEFT OUTER JOIN b
      • JOIN_FULL_OUTER

        public static final JoinType JOIN_FULL_OUTER
        Represents a full outer join: a FULL OUTER JOIN b
      • JOIN_CROSS

        public static final JoinType JOIN_CROSS
        Represents a cross join: a CROSS JOIN b
      • JOIN_UNION

        public static final JoinType JOIN_UNION
        Represents a union join: a UNION JOIN b - not used after rewrite
      • JOIN_SEMI

        public static final JoinType JOIN_SEMI
        internal SEMI Join type
      • JOIN_ANTI_SEMI

        public static final JoinType JOIN_ANTI_SEMI
        internal ANTI SEMI Join type
    • Method Detail

      • getReverseType

        public JoinType getReverseType()
        To switch directions from left to right or right to left. Joins that are not LEFT OUTER or RIGHT OUTER are returned unchanged.
        Returns:
        New JoinType constant for the reverse join type
      • isOuter

        public boolean isOuter()
        Check if this join type is an outer join.
        Returns:
        True if left/right/full outer, false if inner/cross
      • equals

        public boolean equals​(Object other)
        Override Object.equals() to compare objects
        Overrides:
        equals in class Object
        Parameters:
        other - Other object
        Returns:
        True if equal
      • acceptVisitor

        public void acceptVisitor​(LanguageVisitor visitor)
        Description copied from interface: LanguageObject
        Method for accepting a visitor. It is the responsibility of the language object to call back on the visitor.
        Specified by:
        acceptVisitor in interface LanguageObject
        Parameters:
        visitor - Visitor being used
      • hashCode

        public int hashCode()
        Get hash code for this type
        Overrides:
        hashCode in class Object
        Returns:
        Hash code
      • clone

        public Object clone()
        Class is immutable, so clone can just return the same class
        Specified by:
        clone in interface LanguageObject
        Overrides:
        clone in class Object
        Returns:
        Same object - these objects are immutable
      • toString

        public String toString()
        Returns a string representation of an instance of this class.
        Overrides:
        toString in class Object
        Returns:
        String representation of object