Class Command

    • Field Detail

      • TYPE_UNKNOWN

        public static final int TYPE_UNKNOWN
        Represents an unknown type of command
        See Also:
        Constant Field Values
      • TYPE_QUERY

        public static final int TYPE_QUERY
        Represents a SQL SELECT statement
        See Also:
        Constant Field Values
      • TYPE_INSERT

        public static final int TYPE_INSERT
        Represents a SQL INSERT statement
        See Also:
        Constant Field Values
      • TYPE_UPDATE

        public static final int TYPE_UPDATE
        Represents a SQL UPDATE statement
        See Also:
        Constant Field Values
      • TYPE_DELETE

        public static final int TYPE_DELETE
        Represents a SQL DELETE statement
        See Also:
        Constant Field Values
      • TYPE_STORED_PROCEDURE

        public static final int TYPE_STORED_PROCEDURE
        Represents a stored procedure command
        See Also:
        Constant Field Values
      • TYPE_UPDATE_PROCEDURE

        public static final int TYPE_UPDATE_PROCEDURE
        Represents a update stored procedure command
        See Also:
        Constant Field Values
      • TYPE_BATCHED_UPDATE

        public static final int TYPE_BATCHED_UPDATE
        Represents a batched sequence of UPDATE statements
        See Also:
        Constant Field Values
      • tempGroupIDs

        protected TempMetadataStore tempGroupIDs
        All temporary group IDs discovered while resolving this command. The key is a TempMetadataID and the value is an ordered List of TempMetadataID representing the elements.
    • Constructor Detail

      • Command

        public Command()
    • Method Detail

      • getType

        public abstract int getType()
        Return type of command to make it easier to build switch statements by command type.
        Returns:
        Type from TYPE constants
      • getCorrelatedReferences

        public SymbolMap getCorrelatedReferences()
        Get the correlated references to the containing scope only
        Returns:
      • setCorrelatedReferences

        public void setCorrelatedReferences​(SymbolMap correlatedReferences)
      • setTemporaryMetadata

        public void setTemporaryMetadata​(TempMetadataStore metadata)
      • addExternalGroupToContext

        public void addExternalGroupToContext​(GroupSymbol group)
      • setExternalGroupContexts

        public void setExternalGroupContexts​(GroupContext root)
      • getExternalGroupContexts

        public GroupContext getExternalGroupContexts()
      • clone

        public abstract Object clone()
        Description copied from interface: LanguageObject
        Implement clone to make objects cloneable.
        Specified by:
        clone in interface LanguageObject
        Overrides:
        clone in class Object
        Returns:
        Deep clone of this object
      • copyMetadataState

        protected void copyMetadataState​(Command copy)
      • printCommandTree

        public String printCommandTree()
        Print the full tree of commands with indentation - useful for debugging
        Returns:
        String String representation of command tree
      • printCommandTree

        protected void printCommandTree​(StringBuffer str,
                                        int tabLevel)
        Helper method to print command tree at given tab level
        Parameters:
        str - String buffer to add command sub tree to
        tabLevel - Number of tabs to print this command at
      • getOption

        public Option getOption()
        Get the option clause for the query.
        Returns:
        option clause
      • setOption

        public void setOption​(Option option)
        Set the option clause for the query.
        Parameters:
        option - New option clause
      • getProjectedSymbols

        public abstract List<Expression> 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.
        Returns:
        Ordered list of SingleElementSymbol
      • areResultsCachable

        public abstract boolean areResultsCachable()
        Whether the results are cachable.
        Returns:
        True if the results are cachable; false otherwise.
      • getUpdateCommandSymbol

        public static List<Expression> getUpdateCommandSymbol()
      • setProcessorPlan

        public void setProcessorPlan​(ProcessorPlan plan)
      • getCacheHint

        public CacheHint getCacheHint()
      • setCacheHint

        public void setCacheHint​(CacheHint cacheHint)
      • getSourceHint

        public SourceHint getSourceHint()
      • setSourceHint

        public void setSourceHint​(SourceHint sourceHint)
      • toString

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

        protected boolean sameOptionAndHint​(Command cmd)
      • returnsResultSet

        public boolean returnsResultSet()
      • getResultSetColumns

        public List<? extends Expression> getResultSetColumns()
        Returns:
        null if unknown, empty if results are not returned, or the resultset columns
      • getCommandToken

        public static String getCommandToken​(int commandType)
      • getActualCommand

        public Command getActualCommand()
        For a statement such as explain, obtain the actual command
        Returns: