Class SetQuery

  • All Implemented Interfaces:
    Cloneable, LanguageObject

    public class SetQuery
    extends QueryCommand
    This object acts as a Set operator on multiple Queries - UNION, INTERSECT, and EXCEPT can be implemented with this Class
    • Method Detail

      • getType

        public int getType()
        Return type of command.
        Specified by:
        getType in class Command
        Returns:
        TYPE_QUERY
      • setOperation

        public void setOperation​(SetQuery.Operation operation)
        Set type of operation
        Parameters:
        operation - Operation constant as defined in this class
      • getOperation

        public SetQuery.Operation getOperation()
        Get operation for this set
        Returns:
        Operation as defined in this class
      • 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.
        Parameters:
        visitor - Visitor being used
      • getProjectedSymbols

        public List getProjectedSymbols()
        Get the ordered list of all elements returned by this query. These elements may be ElementSymbols or ExpressionSymbols but in all cases each represents a single column.
        Specified by:
        getProjectedSymbols in class Command
        Returns:
        Ordered list of SingleElementSymbol
      • clone

        public Object clone()
        Deep clone this object to produce a new identical query.
        Specified by:
        clone in interface LanguageObject
        Specified by:
        clone in class Command
        Returns:
        Deep clone
      • equals

        public boolean equals​(Object obj)
        Compare two queries for equality.
        Overrides:
        equals in class Object
        Parameters:
        obj - Other object
        Returns:
        True if equal
      • hashCode

        public int hashCode()
        Get hashcode for query. WARNING: This hash code relies on the hash codes of the Select and Criteria clauses. If the query changes, it's hash code will change and it can be lost from collections. Hash code is only valid after query has been completely constructed.
        Overrides:
        hashCode in class Object
        Returns:
        Hash code
      • getQueryCommands

        public List<QueryCommand> getQueryCommands()
        Returns:
        the left and right queries as a list. This list cannot be modified.
      • getProjectedTypes

        public List<Class<?>> getProjectedTypes()
        Returns:
        Returns the projectedTypes.
      • isAll

        public boolean isAll()
      • setAll

        public void setAll​(boolean all)
      • setLeftQuery

        public void setLeftQuery​(QueryCommand leftQuery)
      • setRightQuery

        public void setRightQuery​(QueryCommand rightQuery)