|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
QueryTreeNode is the root class for all query tree nodes. All query tree nodes inherit from QueryTreeNode except for those that extend QueryTreeNodeVector.
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 |
public static final int AUTOINCREMENT_START_INDEX
public static final int AUTOINCREMENT_INC_INDEX
public static final int AUTOINCREMENT_IS_AUTOINCREMENT_INDEX
int beginOffset
int endOffset
private int nodeType
private ContextManager cm
private LanguageConnectionContext lcc
private GenericConstantActionFactory constantActionFactory
Constructor Detail |
public QueryTreeNode()
Method Detail |
public void setContextManager(ContextManager cm)
cm
- The ContextManager.
public final ContextManager getContextManager()
public final NodeFactory getNodeFactory()
public final GenericConstantActionFactory getGenericConstantActionFactory()
public final ExecutionFactory getExecutionFactory()
protected final ClassFactory getClassFactory()
protected final LanguageConnectionContext getLanguageConnectionContext()
public java.lang.String getSPSName()
public int getBeginOffset()
public void setBeginOffset(int beginOffset)
public int getEndOffset()
public void setEndOffset(int endOffset)
protected java.lang.String nodeHeader()
public static java.lang.String formatNodeString(java.lang.String nodeString, int depth)
nodeString
- The node formatted as a Stringdepth
- The depth to indent the given node
public void treePrint()
public void treePrint(int depth)
depth
- The depth of this node in the tree, thus,
the amount to indent it when printing it.
public static void debugPrint(java.lang.String outputString)
outputString
- The String to print
protected static void debugFlush()
public void printSubNodes(int depth)
depth
- The depth to indent the sub-nodes
public java.lang.String toString()
public void printLabel(int depth, java.lang.String label)
depth
- The depth of indentation to use when printing
the labellabel
- The String to print
public QueryTreeNode bind() throws StandardException
StandardException
- Thrown on errorpublic boolean referencesSessionSchema() throws StandardException
StandardException
- Thrown on errorfinal boolean isSessionSchema(SchemaDescriptor sd)
StandardException
- Thrown on errorfinal boolean isSessionSchema(java.lang.String schemaName)
StandardException
- Thrown on errorpublic long getRowEstimate()
public QueryTreeNode optimize() throws StandardException
StandardException
- Thrown on errorpublic GeneratedClass generate(ByteArray ignored) throws StandardException
ignored
- - ignored (he he)
StandardException
- Thrown on errorprotected void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException
acb
- The ActivationClassBuilder for the class being builtmb
- The method for the generated code to go into
StandardException
- Thrown on errorpublic ResultDescription makeResultDescription() throws StandardException
StandardException
- never actually thrown here,
but thrown by subclassespublic DataTypeDescriptor[] getParameterTypes() throws StandardException
StandardException
- on errorpublic ConstantAction makeConstantAction() throws StandardException
StandardException
- Thrown on failurepublic boolean needsSavepoint()
ONLY CALLABLE AFTER GENERATION
public java.lang.String executeStatementName()
public java.lang.String executeSchemaName()
public void setNodeType(int nodeType)
nodeType
- The node type.
protected int getNodeType()
protected boolean isInstanceOf(int nodeType)
nodeType
- The nodeType of interest.
public final DataDictionary getDataDictionary()
public final DependencyManager getDependencyManager()
protected final CompilerContext getCompilerContext()
protected final TypeCompiler getTypeCompiler(TypeId typeId)
typeId
- The TypeId to get a TypeCompiler for
public Visitable accept(Visitor v) throws StandardException
accept
in interface Visitable
v
- the visitor
StandardException
- on errorprotected int getIntProperty(java.lang.String value, java.lang.String key) throws StandardException
value
- Property value as a Stringkey
- Key value of property
StandardException
- Thrown on failurepublic static QueryTreeNode parseQueryText(CompilerContext compilerContext, java.lang.String queryText, java.lang.Object[] paramDefaults, LanguageConnectionContext lcc) throws StandardException
compilerContext
- The CompilerContext to useparamDefaults
- array of parameter defaults used to
initialize parameter nodes, and ultimately
for the optimization of statements with
parameters.lcc
- Current LanguageConnectionContext
StandardException
- Thrown on errorprotected int getStatementType()
public boolean foundString(java.lang.String[] list, java.lang.String search)
public ConstantNode getNullNode(TypeId typeId, ContextManager cm) throws StandardException
typeId
- The TypeId of the datatype of the null valuecm
- The ContextManager
StandardException
- Thrown on errorpublic DataValueDescriptor convertDefaultNode(DataTypeDescriptor typeDescriptor) throws StandardException
typeDescriptor
- A description of the required data type.
StandardException
- Thrown on errorpublic void init(java.lang.Object arg1) throws StandardException
StandardException
- Thrown on errorpublic void init(java.lang.Object arg1, java.lang.Object arg2) throws StandardException
StandardException
- Thrown on errorpublic void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3) throws StandardException
StandardException
- Thrown on errorpublic void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4) throws StandardException
StandardException
- Thrown on errorpublic void init(java.lang.Object arg1, java.lang.Object arg2, java.lang.Object arg3, java.lang.Object arg4, java.lang.Object arg5) throws StandardException
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic 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
StandardException
- Thrown on errorpublic TableName makeTableName(java.lang.String schemaName, java.lang.String flatName) throws StandardException
StandardException
public boolean isAtomic() throws StandardException
StandardException
public java.lang.Object getCursorInfo() throws StandardException
StandardException
protected final TableDescriptor getTableDescriptor(java.lang.String tableName, SchemaDescriptor schema) throws StandardException
tableName
- The name of the table to get the descriptor forschema
- The descriptor for the schema the table lives in.
If null, use the current (default) schema.
StandardException
- Thrown on failurefinal SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName) throws StandardException
schemaName
- The name of the schema we're interested in.
If the name is NULL, get the descriptor for the
current schema.
StandardException
- Thrown on errorfinal SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName, boolean raiseError) throws StandardException
StandardException
java.lang.String verifyClassExist(java.lang.String javaClassName, boolean convertCase) throws StandardException
javaClassName
- The name of the java class to resolve.convertCase
- whether to convert the case before resolving class alias.
StandardException
- Thrown on errorpublic void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, java.lang.String parentResultSetId, boolean dependentScan)
void generateAuthorizeCheck(ActivationClassBuilder acb, MethodBuilder mb, int sqlOperation)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |