|
|||||||||
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
public abstract class 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_CREATE_MODIFY
|
static int |
AUTOINCREMENT_INC_INDEX
|
static int |
AUTOINCREMENT_IS_AUTOINCREMENT_INDEX
|
static int |
AUTOINCREMENT_START_INDEX
|
private int |
beginOffset
|
private ContextManager |
cm
|
private GenericConstantActionFactory |
constantActionFactory
|
private int |
endOffset
|
(package private) boolean |
isPrivilegeCollectionRequired
In Derby SQL Standard Authorization, views, triggers and constraints execute with definer's privileges. |
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. |
(package private) void |
acceptChildren(Visitor v)
Accept a visitor on all child nodes. |
static void |
bindOffsetFetch(ValueNode offset,
ValueNode fetchFirst)
Bind the parameters of OFFSET n ROWS and FETCH FIRST n ROWS ONLY, if any. |
DataTypeDescriptor |
bindRowMultiSet(DataTypeDescriptor originalDTD)
Bind the UDTs in a table type. |
DataTypeDescriptor |
bindUserType(DataTypeDescriptor originalDTD)
Bind a UDT. |
void |
checkReliability(int fragmentBitMask,
java.lang.String fragmentType)
Bind time logic. |
void |
checkReliability(java.lang.String fragmentType,
int fragmentBitMask)
Bind time logic. |
private static boolean |
containsInfo(java.lang.String str)
|
DataValueDescriptor |
convertDefaultNode(DataTypeDescriptor typeDescriptor)
Translate a Default node into a default value, given a type descriptor. |
private void |
createTypeDependency(AliasDescriptor ad)
Declare a dependency on an ANSI UDT, identified by its AliasDescriptor, and check that you have privilege to use it. |
void |
createTypeDependency(DataTypeDescriptor dtd)
Declare a dependency on a type and check that you have privilege to use it. |
protected static void |
debugFlush()
Flush the debug stream out |
static void |
debugPrint(java.lang.String outputString)
Print a String for debugging |
void |
disablePrivilegeCollection()
Triggers, constraints and views get executed with their definer's privileges and they can exist in the system only if their definers' still have all the privileges to creeate them. |
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. |
(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(DataTypeDescriptor type)
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)
Get the descriptor for the named schema. |
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. |
boolean |
isPrivilegeCollectionRequired()
Return true from this method means that we need to collect privilege requirement for this node. |
(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. |
static TableName |
makeTableName(NodeFactory nodeFactory,
ContextManager contextManager,
java.lang.String schemaName,
java.lang.String flatName)
|
TableName |
makeTableName(java.lang.String schemaName,
java.lang.String flatName)
|
protected java.lang.String |
nodeHeader()
Return header information for debug printing of this query tree node. |
int |
orReliability(int newBits)
OR in more reliability bits and return the old reliability value. |
(package private) StatementNode |
parseStatement(java.lang.String sql,
boolean internalSQL)
Parse the a SQL statement from the body of another SQL statement. |
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) |
TableName |
resolveTableToSynonym(TableName tabName)
Resolve table/view reference to a synonym. |
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. |
void |
stackPrint()
Print call stack for debug purposes |
private void |
throwReliabilityException(java.lang.String fragmentType,
int fragmentBitMask)
Common code for the 2 checkReliability functions. |
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) void |
verifyClassExist(java.lang.String javaClassName)
Verify that a java class exists, is accessible (public) and not a class representing a primitive type. |
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
public static final int AUTOINCREMENT_CREATE_MODIFY
private int beginOffset
private int endOffset
private int nodeType
private ContextManager cm
private LanguageConnectionContext lcc
private GenericConstantActionFactory constantActionFactory
boolean isPrivilegeCollectionRequired
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 int getBeginOffset()
public void setBeginOffset(int beginOffset)
beginOffset
- The beginning offset of the SQL substring.public int getEndOffset()
public void setEndOffset(int endOffset)
endOffset
- The ending offset of the SQL substring.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 stackPrint()
public void treePrint(int depth)
depth
- The depth of this node in the tree, thus,
the amount to indent it when printing it.private static boolean containsInfo(java.lang.String str)
public static void debugPrint(java.lang.String outputString)
outputString
- The String to printprotected static void debugFlush()
public void printSubNodes(int depth)
depth
- The depth to indent the sub-nodespublic java.lang.String toString()
toString
in class java.lang.Object
public void printLabel(int depth, java.lang.String label)
depth
- The depth of indentation to use when printing
the labellabel
- The String to printpublic 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 void disablePrivilegeCollection()
public boolean isPrivilegeCollectionRequired()
public long getRowEstimate()
protected 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 DataTypeDescriptor[] getParameterTypes() throws StandardException
StandardException
- on errorpublic ConstantAction makeConstantAction() throws StandardException
StandardException
- Thrown on failurepublic 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 final Visitable accept(Visitor v) throws StandardException
v.visit()
on child nodes as
necessary. Sub-classes should not override this method, but instead
override the acceptChildren(Visitor)
method.
accept
in interface Visitable
v
- the visitor
StandardException
- on errorvoid acceptChildren(Visitor v) throws StandardException
accept(v)
on all visitable fields, as well as
super.acceptChildren(v)
to make sure all visitable fields
defined by the super-class are accepted too.
v
- the visitor
StandardException
- on errors raised by the visitorprotected 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 failureStatementNode parseStatement(java.lang.String sql, boolean internalSQL) throws StandardException
StandardException
protected int getStatementType()
public boolean foundString(java.lang.String[] list, java.lang.String search)
public ConstantNode getNullNode(DataTypeDescriptor type) throws StandardException
type
- Type of the null node.
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 static TableName makeTableName(NodeFactory nodeFactory, ContextManager contextManager, 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 compilation schema.
StandardException
- Thrown on errorfinal SchemaDescriptor getSchemaDescriptor(java.lang.String schemaName, boolean raiseError) throws StandardException
schemaName
- The name of the schema we're interested in.
If the name is NULL, get the descriptor for the current compilation schema.raiseError
- True to raise an error if the schema does not exist,
false to return null if the schema does not exist.
StandardException
- Schema does not exist and raiseError is true.public TableName resolveTableToSynonym(TableName tabName) throws StandardException
tabName
- to match for a synonym
StandardException
- Thrown on errorvoid verifyClassExist(java.lang.String javaClassName) throws StandardException
javaClassName
- The name of the java class to resolve.
StandardException
- Thrown on errorpublic void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, java.lang.String parentResultSetId, boolean dependentScan)
void generateAuthorizeCheck(ActivationClassBuilder acb, MethodBuilder mb, int sqlOperation)
public void checkReliability(java.lang.String fragmentType, int fragmentBitMask) throws StandardException
fragmentType
- Type of fragment as a String, for inclusion in error messages.fragmentBitMask
- Type of fragment as a bitmask of possible fragment types
StandardException
- Thrown on errorpublic void checkReliability(int fragmentBitMask, java.lang.String fragmentType) throws StandardException
fragmentBitMask
- Type of fragment as a bitmask of possible fragment typesfragmentType
- Type of fragment as a String, to be fetch for the error message.
StandardException
- Thrown on errorpublic DataTypeDescriptor bindUserType(DataTypeDescriptor originalDTD) throws StandardException
originalDTD
- A datatype: might be an unbound UDT and might not be
StandardException
public DataTypeDescriptor bindRowMultiSet(DataTypeDescriptor originalDTD) throws StandardException
originalDTD
- A datatype: might be an unbound UDT and might not be
StandardException
public void createTypeDependency(DataTypeDescriptor dtd) throws StandardException
dtd
- Type which may have a dependency declared on it.
StandardException
private void createTypeDependency(AliasDescriptor ad) throws StandardException
StandardException
private void throwReliabilityException(java.lang.String fragmentType, int fragmentBitMask) throws StandardException
fragmentType
- Type of fragment as a string, for inclusion in error messages.fragmentBitMask
- Describes the kinds of expressions we ar suspicious of
StandardException
- Throws an error, always.public int orReliability(int newBits)
public static void bindOffsetFetch(ValueNode offset, ValueNode fetchFirst) throws StandardException
offset
- the OFFSET parameter, if anyfetchFirst
- the FETCH parameter, if any
StandardException
- Thrown on error
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |