org.apache.derby.impl.sql.compile
Class QueryTreeNode

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
All Implemented Interfaces:
Visitable
Direct Known Subclasses:
HashNodeList, JavaValueNode, OrderedColumn, Predicate, QueryTreeNodeVector, ResultSetNode, StatementNode, TableElementNode, TableName, ValueNode

public abstract class QueryTreeNode
extends java.lang.Object
implements Visitable

QueryTreeNode is the root class for all query tree nodes. All query tree nodes inherit from QueryTreeNode except for those that extend QueryTreeNodeVector.

Author:
Jeff Lichtman

Field Summary
static int AUTOINCREMENT_INC_INDEX
           
static int AUTOINCREMENT_IS_AUTOINCREMENT_INDEX
           
static int AUTOINCREMENT_START_INDEX
           
(package private)  int beginOffset
           
private  ContextManager cm
           
private  GenericConstantActionFactory constantActionFactory
           
(package private)  int endOffset
           
private  LanguageConnectionContext lcc
           
private  int nodeType
           
 
Constructor Summary
QueryTreeNode()
           
 
Method Summary
 Visitable accept(Visitor v)
          Accept a visitor, and call v.visit() on child nodes as necessary.
 QueryTreeNode bind()
          Perform the binding operation on a query tree.
 DataValueDescriptor convertDefaultNode(DataTypeDescriptor typeDescriptor)
          Translate a Default node into a default value, given a type descriptor.
protected static void debugFlush()
          Flush the debug stream out
static void debugPrint(java.lang.String outputString)
          Print a String for debugging
 java.lang.String executeSchemaName()
          Returns name of schema in EXECUTE STATEMENT command.
 java.lang.String executeStatementName()
          Returns the name of statement in EXECUTE STATEMENT command.
static java.lang.String formatNodeString(java.lang.String nodeString, int depth)
          Format a node that has been converted to a String for printing as part of a tree.
 boolean foundString(java.lang.String[] list, java.lang.String search)
           
protected  void generate(ActivationClassBuilder acb, MethodBuilder mb)
          Do the code generation for this node.
 GeneratedClass generate(ByteArray ignored)
          this implementation of generate() is a place-holder until all of the nodes that need to, implement it.
(package private)  void generateAuthorizeCheck(ActivationClassBuilder acb, MethodBuilder mb, int sqlOperation)
          Add an authorization check into the passed in method.
 int getBeginOffset()
          Gets the beginning offset of the SQL substring which this query node represents.
protected  ClassFactory getClassFactory()
          Get the ClassFactory to use with this database.
protected  CompilerContext getCompilerContext()
          Get the CompilerContext
 ContextManager getContextManager()
          Get the current ContextManager.
 java.lang.Object getCursorInfo()
           
 DataDictionary getDataDictionary()
          Get the DataDictionary
 DependencyManager getDependencyManager()
           
 int getEndOffset()
          Gets the ending offset of the SQL substring which this query node represents.
 ExecutionFactory getExecutionFactory()
           
 GenericConstantActionFactory getGenericConstantActionFactory()
          Gets the constant action factory for this database.
protected  int getIntProperty(java.lang.String value, java.lang.String key)
          Get the int value of a Property
protected  LanguageConnectionContext getLanguageConnectionContext()
          Gets the LanguageConnectionContext for this connection.
 NodeFactory getNodeFactory()
          Gets the NodeFactory for this database.
protected  int getNodeType()
           
 ConstantNode getNullNode(TypeId typeId, ContextManager cm)
          Get a ConstantNode to represent a typed null value
 DataTypeDescriptor[] getParameterTypes()
          Parameter info is stored in the compiler context.
 long getRowEstimate()
          Get the optimizer's estimate of the number of rows returned or affected for an optimized QueryTree.
(package private)  SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName)
          Get the descriptor for the named schema.
(package private)  SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName, boolean raiseError)
           
 java.lang.String getSPSName()
          Get the name of the SPS that is used to execute this statement.
protected  int getStatementType()
          Return the type of statement, something from StatementType.
protected  TableDescriptor getTableDescriptor(java.lang.String tableName, SchemaDescriptor schema)
          Get the descriptor for the named table within the given schema.
protected  TypeCompiler getTypeCompiler(TypeId typeId)
          Get the TypeCompiler associated with the given TypeId
 void init(java.lang.Object arg1)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10, java.lang.Object arg11)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10, java.lang.Object arg11, java.lang.Object arg12)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10, java.lang.Object arg11, java.lang.Object arg12, java.lang.Object arg13)
          Initialize a query tree node.
 void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5, java.lang.Object arg6, java.lang.Object arg7, java.lang.Object arg8, java.lang.Object arg9, java.lang.Object arg10, java.lang.Object arg11, java.lang.Object arg12, java.lang.Object arg13, java.lang.Object arg14)
          Initialize a query tree node.
 boolean isAtomic()
           
protected  boolean isInstanceOf(int nodeType)
          For final nodes, return whether or not the node represents the specified nodeType.
(package private)  boolean isSessionSchema(SchemaDescriptor sd)
          Checks if the passed schema descriptor is for SESSION schema
(package private)  boolean isSessionSchema(java.lang.String schemaName)
          Checks if the passed schema name is for SESSION schema
 ConstantAction makeConstantAction()
          This creates a class that will do the work that's constant across all Executions of a PreparedStatement.
 ResultDescription makeResultDescription()
          Only DML statements have result descriptions - for all others return null.
 TableName makeTableName(java.lang.String schemaName, java.lang.String flatName)
           
 boolean needsSavepoint()
          Returns whether or not this Statement requires a set/clear savepoint around its execution.
protected  java.lang.String nodeHeader()
          Return header information for debug printing of this query tree node.
 QueryTreeNode optimize()
          Generates an optimized QueryTree from a bound QueryTree.
static QueryTreeNode parseQueryText(CompilerContext compilerContext, java.lang.String queryText, java.lang.Object[] paramDefaults, LanguageConnectionContext lcc)
          Parse some query text and return a parse tree.
 void printLabel(int depth, java.lang.String label)
          Print the given label at the given indentation depth.
 void printSubNodes(int depth)
          Print the sub-nodes of this node.
 boolean referencesSessionSchema()
          Return true if the node references SESSION schema tables (temporary or permanent)
 void setBeginOffset(int beginOffset)
          Sets the beginning offset of the SQL substring which this query node represents.
 void setContextManager(ContextManager cm)
          Set the ContextManager for this node.
 void setEndOffset(int endOffset)
          Sets the ending offset of the SQL substring which this query node represents.
 void setNodeType(int nodeType)
          Set the node type for this node.
 void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, java.lang.String parentResultSetId, boolean dependentScan)
          set the Information gathered from the parent table that is required to peform a referential action on dependent table.
 java.lang.String toString()
          Format this node as a string Each sub-class of QueryTreeNode should implement its own toString() method.
 void treePrint()
          Print this tree for debugging purposes.
 void treePrint(int depth)
          Print this tree for debugging purposes.
(package private)  java.lang.String verifyClassExist(java.lang.String javaClassName, boolean convertCase)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AUTOINCREMENT_START_INDEX

public static final int AUTOINCREMENT_START_INDEX
See Also:
Constant Field Values

AUTOINCREMENT_INC_INDEX

public static final int AUTOINCREMENT_INC_INDEX
See Also:
Constant Field Values

AUTOINCREMENT_IS_AUTOINCREMENT_INDEX

public static final int AUTOINCREMENT_IS_AUTOINCREMENT_INDEX
See Also:
Constant Field Values

beginOffset

int beginOffset

endOffset

int endOffset

nodeType

private int nodeType

cm

private ContextManager cm

lcc

private LanguageConnectionContext lcc

constantActionFactory

private GenericConstantActionFactory constantActionFactory
Constructor Detail

QueryTreeNode

public QueryTreeNode()
Method Detail

setContextManager

public void setContextManager(ContextManager cm)
Set the ContextManager for this node.

Parameters:
cm - The ContextManager.
Returns:
Nothing.

getContextManager

public final ContextManager getContextManager()
Get the current ContextManager.

Returns:
The current ContextManager.

getNodeFactory

public final NodeFactory getNodeFactory()
Gets the NodeFactory for this database.

Returns:
the node factory for this database.

getGenericConstantActionFactory

public final GenericConstantActionFactory getGenericConstantActionFactory()
Gets the constant action factory for this database.

Returns:
the constant action factory.

getExecutionFactory

public final ExecutionFactory getExecutionFactory()

getClassFactory

protected final ClassFactory getClassFactory()
Get the ClassFactory to use with this database.


getLanguageConnectionContext

protected final LanguageConnectionContext getLanguageConnectionContext()
Gets the LanguageConnectionContext for this connection.

Returns:
the lcc for this connection

getSPSName

public java.lang.String getSPSName()
Get the name of the SPS that is used to execute this statement. Only relevant for an ExecSPSNode -- otherwise, returns null.

Returns:
the name of the underlying sps

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.

setBeginOffset

public void setBeginOffset(int beginOffset)
Sets the beginning offset of the SQL substring which this query node represents.


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.

setEndOffset

public void setEndOffset(int endOffset)
Sets the ending offset of the SQL substring which this query node represents.


nodeHeader

protected java.lang.String nodeHeader()
Return header information for debug printing of this query tree node.

Returns:
Header information for debug printing of this query tree node.

formatNodeString

public static java.lang.String formatNodeString(java.lang.String nodeString,
                                                int depth)
Format a node that has been converted to a String for printing as part of a tree. This method indents the String to the given depth by inserting tabs at the beginning of the string, and also after every newline.

Parameters:
nodeString - The node formatted as a String
depth - The depth to indent the given node
Returns:
The node String reformatted with tab indentation

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.

Returns:
Nothing

treePrint

public void treePrint(int depth)
Print this tree for debugging purposes. This recurses through all the sub-nodes and prints them indented by their depth in the tree, starting with the given indentation.

Parameters:
depth - The depth of this node in the tree, thus, the amount to indent it when printing it.
Returns:
Nothing

debugPrint

public static void debugPrint(java.lang.String outputString)
Print a String for debugging

Parameters:
outputString - The String to print
Returns:
Nothing

debugFlush

protected static void debugFlush()
Flush the debug stream out

Returns:
Nothing

printSubNodes

public void printSubNodes(int depth)
Print the sub-nodes of this node. Each sub-class of QueryTreeNode is expected to provide its own printSubNodes() method. In each case, it calls super.printSubNodes(), passing along its depth, to get the sub-nodes of the super-class. Then it prints its own sub-nodes by calling treePrint() on each of its members that is a type of QueryTreeNode. In each case where it calls treePrint(), it should pass "depth + 1" to indicate that the sub-node should be indented one more level when printing. Also, it should call printLabel() to print the name of each sub-node before calling treePrint() on the sub-node, so that the reader of the printed tree can tell what the sub-node is. This printSubNodes() exists in here merely to act as a backstop. In other words, the calls to printSubNodes() move up the type hierarchy, and in this node the calls stop. I would have liked to put the call to super.printSubNodes() in this super-class, but Java resolves "super" statically, so it wouldn't get to the right super-class.

Parameters:
depth - The depth to indent the sub-nodes
Returns:
Nothing

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" + ...

Returns:
This node formatted as a String

printLabel

public void printLabel(int depth,
                       java.lang.String label)
Print the given label at the given indentation depth.

Parameters:
depth - The depth of indentation to use when printing the label
label - The String to print
Returns:
Nothing

bind

public QueryTreeNode bind()
                   throws StandardException
Perform the binding operation on a query tree. Binding consists of permissions checking, view resolution, datatype resolution, and creation of a dependency list (for determining whether a tree or plan is still up to date). This bind() method does nothing. Each node type that can appear at the top of a tree can override this method with its own bind() method that does "something".

Returns:
The bound query tree
Throws:
StandardException - Thrown on error

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

isSessionSchema

final boolean isSessionSchema(SchemaDescriptor sd)
Checks if the passed schema descriptor is for SESSION schema

Returns:
true if the passed schema descriptor is for SESSION schema
Throws:
StandardException - Thrown on error

isSessionSchema

final boolean isSessionSchema(java.lang.String schemaName)
Checks if the passed schema name is for SESSION schema

Returns:
true if the passed schema name is for SESSION schema
Throws:
StandardException - Thrown on error

getRowEstimate

public long getRowEstimate()
Get the optimizer's estimate of the number of rows returned or affected for an optimized QueryTree. For non-optimizable statements (for example, CREATE TABLE), return 0. For optimizable statements, this method will be over-ridden in the statement's root node (DMLStatementNode in all cases we know about so far).

Returns:
0L

optimize

public QueryTreeNode optimize()
                       throws StandardException
Generates an optimized QueryTree from a bound QueryTree. Actually, it annotates the tree in place rather than generating a new tree, but this interface allows the root node of the optmized QueryTree to be different from the root node of the bound QueryTree. For non-optimizable statements (for example, CREATE TABLE), return the bound tree without doing anything. For optimizable statements, this method will be over-ridden in the statement's root node (DMLStatementNode in all cases we know about so far). Throws an exception if the tree is not bound, or if the binding is out of date.

Returns:
An optimized QueryTree
Throws:
StandardException - Thrown on error

generate

public GeneratedClass generate(ByteArray ignored)
                        throws StandardException
this implementation of generate() is a place-holder until all of the nodes that need to, implement it. Only the root, statement nodes implement this flavor of generate; the other nodes will implement the version that returns Generators and takes an activation class builder as an argument.

Parameters:
ignored - - ignored (he he)
Returns:
A GeneratedClass for this statement
Throws:
StandardException - Thrown on error

generate

protected void generate(ActivationClassBuilder acb,
                        MethodBuilder mb)
                 throws StandardException
Do the code generation for this node. This is a place-holder method - it should be over-ridden in the sub-classes.

Parameters:
acb - The ActivationClassBuilder for the class being built
mb - The method for the generated code to go into
Throws:
StandardException - Thrown on error

makeResultDescription

public ResultDescription makeResultDescription()
                                        throws StandardException
Only DML statements have result descriptions - for all others return null. This method is overridden in DMLStatementNode.

Returns:
null
Throws:
StandardException - never actually thrown here, but thrown by subclasses

getParameterTypes

public DataTypeDescriptor[] getParameterTypes()
                                       throws StandardException
Parameter info is stored in the compiler context. Hide this from the callers.

Returns:
null
Throws:
StandardException - 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

needsSavepoint

public boolean needsSavepoint()
Returns whether or not this Statement requires a set/clear savepoint around its execution. The following statement "types" do not require them: Cursor - unnecessary and won't work in a read only environment Xact - savepoint will get blown away underneath us during commit/rollback

ONLY CALLABLE AFTER GENERATION

Returns:
boolean Whether or not this Statement requires a set/clear savepoint

executeStatementName

public java.lang.String executeStatementName()
Returns the name of statement in EXECUTE STATEMENT command. Returns null for all other commands.

Returns:
String null unless overridden for Execute Statement command

executeSchemaName

public java.lang.String executeSchemaName()
Returns name of schema in EXECUTE STATEMENT command. Returns null for all other commands.

Returns:
String schema for EXECUTE STATEMENT null for all others

setNodeType

public void setNodeType(int nodeType)
Set the node type for this node.

Parameters:
nodeType - The node type.
Returns:
Nothing.

getNodeType

protected int getNodeType()

isInstanceOf

protected boolean isInstanceOf(int nodeType)
For final nodes, return whether or not the node represents the specified nodeType.

Parameters:
nodeType - The nodeType of interest.
Returns:
Whether or not the node represents the specified nodeType.

getDataDictionary

public final DataDictionary getDataDictionary()
Get the DataDictionary

Returns:
The DataDictionary

getDependencyManager

public final DependencyManager getDependencyManager()

getCompilerContext

protected final CompilerContext getCompilerContext()
Get the CompilerContext

Returns:
The CompilerContext

getTypeCompiler

protected final TypeCompiler getTypeCompiler(TypeId typeId)
Get the TypeCompiler associated with the given TypeId

Parameters:
typeId - The TypeId to get a TypeCompiler for
Returns:
The corresponding TypeCompiler

accept

public Visitable accept(Visitor v)
                 throws StandardException
Accept a visitor, and call v.visit() on child nodes as necessary.

Specified by:
accept in interface Visitable
Parameters:
v - the visitor
Throws:
StandardException - on error

getIntProperty

protected int getIntProperty(java.lang.String value,
                             java.lang.String key)
                      throws StandardException
Get the int value of a Property

Parameters:
value - Property value as a String
key - Key value of property
Returns:
The int value of the property
Throws:
StandardException - Thrown on failure

parseQueryText

public static QueryTreeNode parseQueryText(CompilerContext compilerContext,
                                           java.lang.String queryText,
                                           java.lang.Object[] paramDefaults,
                                           LanguageConnectionContext lcc)
                                    throws StandardException
Parse some query text and return a parse tree.

Parameters:
compilerContext - The CompilerContext to use
paramDefaults - array of parameter defaults used to initialize parameter nodes, and ultimately for the optimization of statements with parameters.
lcc - Current LanguageConnectionContext
Returns:
ResultSetNode The parse tree.
Throws:
StandardException - Thrown on error

getStatementType

protected int getStatementType()
Return the type of statement, something from StatementType.

Returns:
the type of statement

foundString

public boolean foundString(java.lang.String[] list,
                           java.lang.String search)

getNullNode

public ConstantNode getNullNode(TypeId typeId,
                                ContextManager cm)
                         throws StandardException
Get a ConstantNode to represent a typed null value

Parameters:
typeId - The TypeId of the datatype of the null value
cm - The ContextManager
Returns:
A ConstantNode with the specified type, and a value of null
Throws:
StandardException - Thrown on error

convertDefaultNode

public DataValueDescriptor convertDefaultNode(DataTypeDescriptor typeDescriptor)
                                       throws StandardException
Translate a Default node into a default value, given a type descriptor.

Parameters:
typeDescriptor - A description of the required data type.
Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7,
                 java.lang.Object arg8)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7,
                 java.lang.Object arg8,
                 java.lang.Object arg9)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7,
                 java.lang.Object arg8,
                 java.lang.Object arg9,
                 java.lang.Object arg10)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7,
                 java.lang.Object arg8,
                 java.lang.Object arg9,
                 java.lang.Object arg10,
                 java.lang.Object arg11)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7,
                 java.lang.Object arg8,
                 java.lang.Object arg9,
                 java.lang.Object arg10,
                 java.lang.Object arg11,
                 java.lang.Object arg12)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7,
                 java.lang.Object arg8,
                 java.lang.Object arg9,
                 java.lang.Object arg10,
                 java.lang.Object arg11,
                 java.lang.Object arg12,
                 java.lang.Object arg13)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object arg1,
                 java.lang.Object arg2,
                 java.lang.Object arg3,
                 java.lang.Object arg4,
                 java.lang.Object arg5,
                 java.lang.Object arg6,
                 java.lang.Object arg7,
                 java.lang.Object arg8,
                 java.lang.Object arg9,
                 java.lang.Object arg10,
                 java.lang.Object arg11,
                 java.lang.Object arg12,
                 java.lang.Object arg13,
                 java.lang.Object arg14)
          throws StandardException
Initialize a query tree node.

Throws:
StandardException - Thrown on error

makeTableName

public TableName makeTableName(java.lang.String schemaName,
                               java.lang.String flatName)
                        throws StandardException
Throws:
StandardException

isAtomic

public boolean isAtomic()
                 throws StandardException
Throws:
StandardException

getCursorInfo

public java.lang.Object getCursorInfo()
                               throws StandardException
Throws:
StandardException

getTableDescriptor

protected final TableDescriptor getTableDescriptor(java.lang.String tableName,
                                                   SchemaDescriptor schema)
                                            throws StandardException
Get the descriptor for the named table within the given schema. If the schema parameter is NULL, it looks for the table in the current (default) schema. Table descriptors include object ids, object types (table, view, etc.) If the schema is SESSION, then before looking into the data dictionary for persistent tables, it first looks into LCC for temporary tables. If no temporary table tableName found for the SESSION schema, then it goes and looks through the data dictionary for persistent table We added getTableDescriptor here so that we can look for non data dictionary tables(ie temp tables) here. Any calls to getTableDescriptor in data dictionary should be only for persistent tables

Parameters:
tableName - The name of the table to get the descriptor for
schema - The descriptor for the schema the table lives in. If null, use the current (default) schema.
Returns:
The descriptor for the table, null if table does not exist.
Throws:
StandardException - Thrown on failure

getSchemaDescriptor

final SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName)
                                    throws StandardException
Get the descriptor for the named schema. If the schemaName parameter is NULL, it gets the descriptor for the current (default) schema. Schema descriptors include authorization ids and schema ids. SQL92 allows a schema to specify a default character set - we will not support this. Will check default schema for a match before scanning a system table.

Parameters:
schemaName - The name of the schema we're interested in. If the name is NULL, get the descriptor for the current schema.
Returns:
The descriptor for the schema.
Throws:
StandardException - Thrown on error

getSchemaDescriptor

final SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName,
                                           boolean raiseError)
                                    throws StandardException
Throws:
StandardException

verifyClassExist

java.lang.String verifyClassExist(java.lang.String javaClassName,
                                  boolean convertCase)
                            throws StandardException
Parameters:
javaClassName - The name of the java class to resolve.
convertCase - whether to convert the case before resolving class alias.
Returns:
Resolved class name or class alias name.
Throws:
StandardException - Thrown on error

setRefActionInfo

public void setRefActionInfo(long fkIndexConglomId,
                             int[] fkColArray,
                             java.lang.String parentResultSetId,
                             boolean dependentScan)
set the Information gathered from the parent table that is required to peform a referential action on dependent table.

Returns:
Nothing.

generateAuthorizeCheck

void generateAuthorizeCheck(ActivationClassBuilder acb,
                            MethodBuilder mb,
                            int sqlOperation)
Add an authorization check into the passed in method.



Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.