Documentation of 'org.apache.derby.impl.sql.compile.QueryTreeNode' Java class
QueryTreeNode
org.apache.derby.impl.sql.compile

Class QueryTreeNode

    • Method Detail

      • getOptimizerFactory

        public final OptimizerFactory getOptimizerFactory()
        Gets the NodeFactory for this database.
        Returns:
        the node factory for this database.
      • getOptimizerTracer

        public OptTrace getOptimizerTracer()
        Convenience method for finding the optimizer tracer
      • optimizerTracingIsOn

        public boolean optimizerTracingIsOn()
        Convenience method for checking whether optimizer tracing is on
      • getGenericConstantActionFactory

        public final GenericConstantActionFactory getGenericConstantActionFactory()
        Gets the constant action factory for this database.
        Returns:
        the constant action factory.
      • getBeginOffset

        public int getBeginOffset()
        Gets the beginning offset of the SQL substring which this query node represents.
        Returns:
        The beginning offset of the SQL substring. -1 means unknown.
      • setBeginOffset

        public void setBeginOffset(int beginOffset)
        Sets the beginning offset of the SQL substring which this query node represents.
        Parameters:
        beginOffset - The beginning offset of the SQL substring.
      • getEndOffset

        public int getEndOffset()
        Gets the ending offset of the SQL substring which this query node represents.
        Returns:
        The ending offset of the SQL substring. -1 means unknown.
      • setEndOffset

        public void setEndOffset(int endOffset)
        Sets the ending offset of the SQL substring which this query node represents.
        Parameters:
        endOffset - The ending offset of the SQL substring.
      • treePrint

        public void treePrint()
        Print this tree for debugging purposes. This recurses through all the sub-nodes and prints them indented by their depth in the tree.
      • toString

        public java.lang.String toString()
        Format this node as a string Each sub-class of QueryTreeNode should implement its own toString() method. In each case, toString() should format the class members that are not sub-types of QueryTreeNode (printSubNodes() takes care of following the references to sub-nodes, and toString() takes care of all members that are not sub-nodes). Newlines should be used liberally - one good way to do this is to have a newline at the end of each formatted member. It's also a good idea to put the name of each member in front of the formatted value. For example, the code might look like: "memberName: " + memberName + "\n" + ... Vector members containing subclasses of QueryTreeNode should subclass QueryTreeNodeVector. Such subclasses form a special case: These classes should not implement printSubNodes, since there is generic handling in QueryTreeNodeVector. They should only implement toString if they contain additional members.
        Overrides:
        toString in class java.lang.Object
        Returns:
        This node formatted as a String
      • referencesSessionSchema

        public boolean referencesSessionSchema()
                                        throws StandardException
        Return true if the node references SESSION schema tables (temporary or permanent)
        Returns:
        true if references SESSION schema tables, else false
        Throws:
        StandardException - Thrown on error
      • makeConstantAction

        public ConstantAction makeConstantAction()
                                          throws StandardException
        This creates a class that will do the work that's constant across all Executions of a PreparedStatement. It's up to our subclasses to override this method if they need to compile constant actions into PreparedStatements.
        Throws:
        StandardException - Thrown on failure
      • getDataDictionary

        public final DataDictionary getDataDictionary()
        Get the DataDictionary
        Returns:
        The DataDictionary
      • addTag

        public void addTag(java.lang.String tag)
        Description copied from interface: Visitable
        Add a tag to this Visitable.
        Specified by:
        addTag in interface Visitable
      • taggedWith

        public boolean taggedWith(java.lang.String tag)
        Description copied from interface: Visitable
        Return true if this Visitable is tagged with the indicated tag.
        Specified by:
        taggedWith in interface Visitable
      • checkReliability

        public void checkReliability(java.lang.String fragmentType,
                                     int fragmentBitMask)
                              throws StandardException
        Bind time logic. Raises an error if this ValueNode, once compiled, returns unstable results AND if we're in a context where unstable results are forbidden. Called by children who may NOT appear in the WHERE subclauses of ADD TABLE clauses.
        Parameters:
        fragmentType - Type of fragment as a String, for inclusion in error messages.
        fragmentBitMask - Type of fragment as a bitmask of possible fragment types
        Throws:
        StandardException - Thrown on error
      • checkReliability

        public void checkReliability(int fragmentBitMask,
                                     java.lang.String fragmentType)
                              throws StandardException
        Bind time logic. Raises an error if this ValueNode, once compiled, returns unstable results AND if we're in a context where unstable results are forbidden. Called by children who may NOT appear in the WHERE subclauses of ADD TABLE clauses.
        Parameters:
        fragmentBitMask - Type of fragment as a bitmask of possible fragment types
        fragmentType - Type of fragment as a String, to be fetch for the error message.
        Throws:
        StandardException - Thrown on error
      • bindUserType

        public DataTypeDescriptor bindUserType(DataTypeDescriptor originalDTD)
                                        throws StandardException
        Bind a UDT. This involves looking it up in the DataDictionary and filling in its class name.
        Parameters:
        originalDTD - A datatype: might be an unbound UDT and might not be
        Returns:
        The bound UDT if originalDTD was an unbound UDT; otherwise returns originalDTD.
        Throws:
        StandardException
      • bindRowMultiSet

        public DataTypeDescriptor bindRowMultiSet(DataTypeDescriptor originalDTD)
                                           throws StandardException
        Bind the UDTs in a table type.
        Parameters:
        originalDTD - A datatype: might be an unbound UDT and might not be
        Returns:
        The bound table type if originalDTD was an unbound table type; otherwise returns originalDTD.
        Throws:
        StandardException
      • createTypeDependency

        public void createTypeDependency(DataTypeDescriptor dtd)
                                  throws StandardException
        Declare a dependency on a type and check that you have privilege to use it. This is only used if the type is an ANSI UDT.
        Parameters:
        dtd - Type which may have a dependency declared on it.
        Throws:
        StandardException
      • orReliability

        public int orReliability(int newBits)
        OR in more reliability bits and return the old reliability value.
      • bindOffsetFetch

        public static void bindOffsetFetch(ValueNode offset,
                                           ValueNode fetchFirst)
                                    throws StandardException
        Bind the parameters of OFFSET n ROWS and FETCH FIRST n ROWS ONLY, if any.
        Parameters:
        offset - the OFFSET parameter, if any
        fetchFirst - the FETCH parameter, if any
        Throws:
        StandardException - Thrown on error
      • getOffsetOrderedNodes

        public <N extends QueryTreeNode> java.util.SortedSet<N> getOffsetOrderedNodes(java.lang.Class<N> type)
                                                                               throws StandardException
        Get all child nodes of a specific type, and return them in the order in which they appear in the SQL text.
        Type Parameters:
        N - the type of node to look for
        Parameters:
        type - the type of node to look for
        Returns:
        all nodes of the specified type
        Throws:
        StandardException - if an error occurs

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.