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

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
      extended byorg.apache.derby.impl.sql.compile.ResultSetNode
          extended byorg.apache.derby.impl.sql.compile.FromTable
              extended byorg.apache.derby.impl.sql.compile.FromVTI
All Implemented Interfaces:
Optimizable, Visitable, VTIEnvironment

public class FromVTI
extends FromTable
implements VTIEnvironment

A FromVTI represents a VTI in the FROM list of a DML statement.

Author:
Jerry Brenner

Field Summary
private  FormatableHashtable compileTimeConstants
           
private  boolean controlsDeferral
           
(package private)  JBitSet correlationMap
           
(package private)  JBitSet dependencyMap
           
private  boolean emptyForUpdate
          Was the FOR UPDATE clause empty (no columns specified).
(package private)  double estimatedCost
           
(package private)  double estimatedRowCount
           
(package private)  TableName exposedName
           
private  boolean forUpdatePresent
          Was a FOR UPDATE clause specified in a SELECT statement.
private  boolean implementsPushable
           
(package private)  boolean implementsVTICosting
           
private  boolean isInsensitive
           
(package private)  boolean isTarget
           
(package private)  boolean materializable
           
private  JavaValueNode[] methodParms
           
(package private)  NewInvocationNode newInvocation
           
protected  int numVTICols
           
(package private)  boolean optimized
           
private  java.sql.PreparedStatement ps
           
private  PredicateList restrictionList
           
private  int resultSetType
           
(package private)  java.sql.ResultSet rs
           
(package private)  SubqueryList subqueryList
           
(package private)  boolean supportsMultipleInstantiations
           
protected  boolean version2
           
(package private)  boolean vtiCosted
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.FromTable
bestAccessPath, bestCostEstimate, bestSortAvoidancePath, correlationName, corrTableName, currentAccessPath, hashKeyColumns, initialCapacity, level, loadFactor, maxCapacity, tableNumber, tableProperties, trulyTheBestAccessPath, userSpecifiedJoinStrategy
 
Fields inherited from class org.apache.derby.impl.sql.compile.ResultSetNode
costEstimate, cursorTargetTable, insertSource, optimizer, referencedTableMap, resultColumns, resultSetNumber, scratchCostEstimate, statementResultSet
 
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset
 
Constructor Summary
FromVTI()
           
 
Method Summary
 Visitable accept(Visitor v)
          Accept a visitor, and call v.visit() on child nodes as necessary.
 void bindExpressions(FromList fromListParam)
          Bind the expressions in this VTI.
 ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam)
          Bind the non VTI tables in this ResultSetNode.
 ResultSetNode bindVTITables(FromList fromListParam)
          Bind this VTI that appears in the FROM list.
 CostEstimate estimateCost(OptimizablePredicateList predList, ConglomerateDescriptor cd, CostEstimate outerCost, Optimizer optimizer, RowOrdering rowOrdering)
          Estimate the cost of scanning this Optimizable using the given predicate list with the given conglomerate.
 void generate(ActivationClassBuilder acb, MethodBuilder mb)
          Generation on a FromVTI creates a wrapper around the user's java.sql.ResultSet
private  void generateConstructor(ActivationClassBuilder acb, MethodBuilder mb, boolean reuseablePs)
           
protected  ResultSetNode genProjectRestrict(int numTables)
          Put a ProjectRestrictNode on top of each FromTable in the FromList.
private  ResultColumnList genResultColList(TableDescriptor td)
           
 ResultColumnList getAllResultColumns(TableName allTableName)
          Expand a "*" into a ResultColumnList with all of the result columns from the subquery.
 DeferModification getDeferralControl()
          Get the DeferModification interface associated with this VTI
 java.lang.String getExposedName()
          Get the exposed name for this table, which is the name that can be used to refer to it in the rest of the query.
 TableName getExposedTableName()
           
private  int[] getForUpdateColumnList()
           
 ResultColumn getMatchingColumn(ColumnReference columnReference)
          Try to find a ResultColumn in the table represented by this FromBaseTable that matches the name in the given ColumnReference.
private  java.lang.Object getNewInstance()
           
 NewInvocationNode getNewInvocation()
          Return the new invocation from this node.
(package private)  java.util.Vector getNodesFromParameters(java.lang.Class nodeClass)
          Get all of the nodes of the specified class from the parameters to this VTI.
 java.lang.String getOriginalSQL()
          Return the SQL text of the original SQL statement.
 java.sql.ResultSetMetaData getResultSetMetaData()
          Get the ResultSetMetaData for the class/object.
 int getResultSetType()
           
private  int getScanArguments(ActivationClassBuilder acb, MethodBuilder mb)
           
 java.lang.Object getSharedState(java.lang.String key)
          Get an an object associated with a key from set of objects maintained with the statement plan.
private  UUID getSpecialTriggerVTITableName(LanguageConnectionContext lcc, java.lang.String className)
          Check and see if we have a special trigger VTI.
 int getStatementIsolationLevel()
          Get the specific JDBC isolation of the statement.
(package private)  java.lang.String getVTIName()
           
 void init(java.lang.Object newInvocation, java.lang.Object correlationName, java.lang.Object derivedRCL, java.lang.Object tableProperties)
          Initialize a query tree node.
 void init(java.lang.Object newInvocation, java.lang.Object correlationName, java.lang.Object derivedRCL, java.lang.Object tableProperties, java.lang.Object exposedTableName)
          Initialize a query tree node.
 boolean isCompileTime()
          Return true if this instance of the VTI has been created for compilation, false if it is for runtime execution.
 boolean isMaterializable()
          Tell whether this Optimizable is materializable
(package private)  boolean isUpdatableCursor()
           
 boolean legalJoinOrder(JBitSet assignedTableMap)
          Can this Optimizable appear at the current location in the join order.
protected  void markUpdatableByCursor(java.util.Vector updateColumns)
          Mark as updatable all the columns in the result column list of this FromBaseTable that match the columns in the given update column list.
 Optimizable modifyAccessPath(JBitSet outerTables)
          Modify the access path for this Optimizable, as necessary.
 boolean needsSpecialRCLBinding()
           
 boolean performMaterialization(JBitSet outerTables)
          Return whether or not to materialize this ResultSet tree.
 ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList)
          Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode.
 void printSubNodes(int depth)
          Prints the sub-nodes of this object.
 boolean pushOptPredicate(OptimizablePredicate optimizablePredicate)
          Push an OptimizablePredicate down, if this node accepts it.
 boolean referencesTarget(java.lang.String name, boolean baseTable)
          Search to see if a query references the specifed table name.
 void setSharedState(java.lang.String key, java.io.Serializable value)
          Saves an object associated with a key that will be maintained for the lifetime of the statement plan.
(package private)  void setTarget()
          Mark this VTI as the target of a delete or update.
 boolean supportsMultipleInstantiations()
          Tell whether this Optimizable can be instantiated multiple times
 java.lang.String toString()
          Convert this object to a String.
 
Methods inherited from class org.apache.derby.impl.sql.compile.FromTable
areAllColumnsProjected, assignCostEstimate, canBeOrdered, considerSortAvoidancePath, convertAbsoluteToRelativeColumnPosition, cursorTargetTable, decrementLevel, feasibleJoinStrategy, fillInReferencedTableMap, flatten, forUpdate, getBaseTableName, getBestAccessPath, getBestSortAvoidancePath, getCostEstimate, getCurrentAccessPath, getFromTableByName, getLevel, getName, getNumColumnsReturned, getProperties, getResultColumnsForList, getSchemaDescriptor, getSchemaDescriptor, getScratchCostEstimate, getTableDescriptor, getTableName, getTableNumber, getTrulyTheBestAccessPath, getUserSpecifiedJoinStrategy, hashKeyColumns, hasTableNumber, init, initAccessPaths, initialCapacity, isBaseTable, isCoveringIndex, isFlattenableJoinNode, isOneRowScan, isTargetTable, loadFactor, LOJ_reorderable, maxCapacity, memoryUsageOK, nextAccessPath, optimizeIt, optimizeSubqueries, pullOptPredicates, pushExpressions, rememberAsBest, rememberJoinStrategyAsBest, rememberSortAvoidancePath, resetJoinStrategies, setAllColumnsProjected, setCostEstimate, setHashKeyColumns, setLevel, setProperties, setTableNumber, startOptimizing, tellRowOrderingAboutConstantColumns, transformOuterJoins, uniqueJoin, verifyProperties
 
Methods inherited from class org.apache.derby.impl.sql.compile.ResultSetNode
addNewPredicate, assignResultSetNumber, bindExpressionsWithTables, bindResultColumns, bindResultColumns, bindTargetExpressions, bindUntypedNullsToResultColumns, changeAccessPath, closeMethodArgument, columnTypesAndLengthsMatch, considerMaterialization, enhanceRCLForInsert, ensurePredicateList, flattenableInFromSubquery, generateNormalizationResultSet, generateResultSet, genNewRCForInsert, genNormalizeResultSetNode, genProjectRestrict, genProjectRestrictForReordering, getCostEstimate, getCursorTargetTable, getFinalCostEstimate, getFromList, getNewCostEstimate, getOptimizer, getReferencedTableMap, getResultColumns, getResultSetNumber, isNotExists, isOneRowResultSet, isOrderedOn, isPossibleDistinctScan, isUpdatableCursor, LOJgetReferencedTables, makeResultDescription, makeResultDescriptors, markAsCursorTargetTable, markForDistinctScan, markOrderingDependent, markStatementResultSet, modifyAccessPaths, notCursorTargetTable, notFlattenableJoin, numDistinctAggregates, optimize, parseDefault, projectResultColumns, pushOrderByList, rejectParameters, rejectXMLValues, renameGeneratedResultNames, replaceDefaults, returnsAtMostOneRow, setInsertSource, setReferencedTableMap, setResultColumns, setResultToBooleanTrueNode, setTableConstructorTypes, subqueryReferencesTarget, updateTargetLockMode, verifySelectStarSubquery
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
bind, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.sql.compile.Optimizable
getDataDictionary, getReferencedTableMap, getResultSetNumber
 

Field Detail

correlationMap

JBitSet correlationMap

dependencyMap

JBitSet dependencyMap

newInvocation

NewInvocationNode newInvocation

exposedName

TableName exposedName

subqueryList

SubqueryList subqueryList

implementsVTICosting

boolean implementsVTICosting

optimized

boolean optimized

materializable

boolean materializable

isTarget

boolean isTarget

rs

java.sql.ResultSet rs

compileTimeConstants

private FormatableHashtable compileTimeConstants

numVTICols

protected int numVTICols

restrictionList

private PredicateList restrictionList

forUpdatePresent

private boolean forUpdatePresent
Was a FOR UPDATE clause specified in a SELECT statement.


emptyForUpdate

private boolean emptyForUpdate
Was the FOR UPDATE clause empty (no columns specified).


estimatedCost

double estimatedCost

estimatedRowCount

double estimatedRowCount

supportsMultipleInstantiations

boolean supportsMultipleInstantiations

vtiCosted

boolean vtiCosted

version2

protected boolean version2

implementsPushable

private boolean implementsPushable

ps

private java.sql.PreparedStatement ps

methodParms

private JavaValueNode[] methodParms

controlsDeferral

private boolean controlsDeferral

isInsensitive

private boolean isInsensitive

resultSetType

private int resultSetType
Constructor Detail

FromVTI

public FromVTI()
Method Detail

init

public void init(java.lang.Object newInvocation,
                 java.lang.Object correlationName,
                 java.lang.Object derivedRCL,
                 java.lang.Object tableProperties)
          throws StandardException
Description copied from class: QueryTreeNode
Initialize a query tree node.

Overrides:
init in class QueryTreeNode
Parameters:
newInvocation - The constructor for the VTI
correlationName - The correlation name
derivedRCL - The derived column list
tableProperties - Properties list associated with the table
Throws:
StandardException - Thrown on error

init

public void init(java.lang.Object newInvocation,
                 java.lang.Object correlationName,
                 java.lang.Object derivedRCL,
                 java.lang.Object tableProperties,
                 java.lang.Object exposedTableName)
          throws StandardException
Description copied from class: QueryTreeNode
Initialize a query tree node.

Overrides:
init in class QueryTreeNode
Parameters:
newInvocation - The constructor for the VTI
correlationName - The correlation name
derivedRCL - The derived column list
tableProperties - Properties list associated with the table
exposedTableName - The table name (TableName class)
Throws:
StandardException - Thrown on error

estimateCost

public CostEstimate estimateCost(OptimizablePredicateList predList,
                                 ConglomerateDescriptor cd,
                                 CostEstimate outerCost,
                                 Optimizer optimizer,
                                 RowOrdering rowOrdering)
                          throws StandardException
Description copied from interface: Optimizable
Estimate the cost of scanning this Optimizable using the given predicate list with the given conglomerate. It is assumed that the predicate list has already been classified. This cost estimate is just for one scan, not for the life of the query.

Specified by:
estimateCost in interface Optimizable
Overrides:
estimateCost in class FromTable
Throws:
StandardException - Thrown on error
See Also:
Optimizable.estimateCost(org.apache.derby.iapi.sql.compile.OptimizablePredicateList, org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor, org.apache.derby.iapi.sql.compile.CostEstimate, org.apache.derby.iapi.sql.compile.Optimizer, org.apache.derby.iapi.sql.compile.RowOrdering)

legalJoinOrder

public boolean legalJoinOrder(JBitSet assignedTableMap)
Description copied from interface: Optimizable
Can this Optimizable appear at the current location in the join order. In other words, have the Optimizable's dependencies been satisfied?

Specified by:
legalJoinOrder in interface Optimizable
Overrides:
legalJoinOrder in class FromTable
See Also:
Optimizable.legalJoinOrder(org.apache.derby.iapi.util.JBitSet)

isMaterializable

public boolean isMaterializable()
Description copied from interface: Optimizable
Tell whether this Optimizable is materializable

Specified by:
isMaterializable in interface Optimizable
Overrides:
isMaterializable in class FromTable
See Also:
Optimizable.isMaterializable()

supportsMultipleInstantiations

public boolean supportsMultipleInstantiations()
Description copied from interface: Optimizable
Tell whether this Optimizable can be instantiated multiple times

Specified by:
supportsMultipleInstantiations in interface Optimizable
Overrides:
supportsMultipleInstantiations in class FromTable
See Also:
Optimizable.supportsMultipleInstantiations()

modifyAccessPath

public Optimizable modifyAccessPath(JBitSet outerTables)
                             throws StandardException
Description copied from interface: Optimizable
Modify the access path for this Optimizable, as necessary. This includes things like adding a result set to translate from index rows to base rows

Specified by:
modifyAccessPath in interface Optimizable
Overrides:
modifyAccessPath in class FromTable
Throws:
StandardException - Thrown on error
See Also:
Optimizable.modifyAccessPath(org.apache.derby.iapi.util.JBitSet)

pushOptPredicate

public boolean pushOptPredicate(OptimizablePredicate optimizablePredicate)
                         throws StandardException
Description copied from interface: Optimizable
Push an OptimizablePredicate down, if this node accepts it.

Specified by:
pushOptPredicate in interface Optimizable
Overrides:
pushOptPredicate in class FromTable
Throws:
StandardException - Thrown on error
See Also:
Optimizable.pushOptPredicate(org.apache.derby.iapi.sql.compile.OptimizablePredicate)

toString

public java.lang.String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class FromTable
Returns:
This object as a String

printSubNodes

public void printSubNodes(int depth)
Prints the sub-nodes of this object. See QueryTreeNode.java for how tree printing is supposed to work.

Overrides:
printSubNodes in class ResultSetNode
Parameters:
depth - The depth of this node in the tree
Returns:
Nothing

getNewInvocation

public NewInvocationNode getNewInvocation()
Return the new invocation from this node.

Returns:
ResultSetNode The new invocation from this node.

getExposedName

public java.lang.String getExposedName()
Get the exposed name for this table, which is the name that can be used to refer to it in the rest of the query.

Overrides:
getExposedName in class FromTable
Returns:
The exposed name for this table.

getExposedTableName

public TableName getExposedTableName()
Returns:
the table name used for matching with column references.

setTarget

void setTarget()
Mark this VTI as the target of a delete or update.

Returns:
Nothing.

bindNonVTITables

public ResultSetNode bindNonVTITables(DataDictionary dataDictionary,
                                      FromList fromListParam)
                               throws StandardException
Bind the non VTI tables in this ResultSetNode. This includes getting their descriptors from the data dictionary and numbering them.

Overrides:
bindNonVTITables in class ResultSetNode
Parameters:
dataDictionary - The DataDictionary to use for binding
fromListParam - FromList to use/append to.
Returns:
ResultSetNode
Throws:
StandardException - Thrown on error

getVTIName

java.lang.String getVTIName()
Returns:
The name of the VTI, mainly for debugging and error messages.

bindVTITables

public ResultSetNode bindVTITables(FromList fromListParam)
                            throws StandardException
Bind this VTI that appears in the FROM list.

Overrides:
bindVTITables in class ResultSetNode
Parameters:
fromListParam - FromList to use/append to.
Returns:
ResultSetNode The bound FromVTI.
Throws:
StandardException - Thrown on error

getResultSetMetaData

public java.sql.ResultSetMetaData getResultSetMetaData()
                                                throws StandardException
Get the ResultSetMetaData for the class/object. We first look for the optional static method which has the same signature as the constructor. If it doesn't exist, then we instantiate an object and get the ResultSetMetaData from that object.

Returns:
The ResultSetMetaData from the class/object.
Throws:
StandardException - Thrown on error

getNewInstance

private java.lang.Object getNewInstance()
                                 throws StandardException
Throws:
StandardException

getDeferralControl

public DeferModification getDeferralControl()
                                     throws StandardException
Get the DeferModification interface associated with this VTI

Returns:
null if the VTI uses the default modification deferral
Throws:
StandardException

getResultSetType

public int getResultSetType()
Returns:
the ResultSet type of the VTI, TYPE_FORWARD_ONLY if the getResultSetType() method of the VTI class throws an exception.

bindExpressions

public void bindExpressions(FromList fromListParam)
                     throws StandardException
Bind the expressions in this VTI. This means binding the sub-expressions, as well as figuring out what the return type is for each expression.

Overrides:
bindExpressions in class ResultSetNode
Parameters:
fromListParam - FromList to use/append to.
Returns:
Nothing
Throws:
StandardException - Thrown on error

getNodesFromParameters

java.util.Vector getNodesFromParameters(java.lang.Class nodeClass)
                                  throws StandardException
Get all of the nodes of the specified class from the parameters to this VTI.

Parameters:
nodeClass - The Class of interest.
Returns:
A vector containing all of the nodes of interest.
Throws:
StandardException - Thrown on error

getAllResultColumns

public ResultColumnList getAllResultColumns(TableName allTableName)
                                     throws StandardException
Expand a "*" into a ResultColumnList with all of the result columns from the subquery.

Overrides:
getAllResultColumns in class ResultSetNode
Parameters:
allTableName - The qualifier on the "*"
Returns:
ResultColumnList The expanded list
Throws:
StandardException - Thrown on error

getMatchingColumn

public ResultColumn getMatchingColumn(ColumnReference columnReference)
                               throws StandardException
Try to find a ResultColumn in the table represented by this FromBaseTable that matches the name in the given ColumnReference.

Overrides:
getMatchingColumn in class ResultSetNode
Parameters:
columnReference - The columnReference whose name we're looking for in the given table.
Returns:
A ResultColumn whose expression is the ColumnNode that matches the ColumnReference. Returns null if there is no match.
Throws:
StandardException - Thrown on error

preprocess

public ResultSetNode preprocess(int numTables,
                                GroupByList gbl,
                                FromList fromList)
                         throws StandardException
Preprocess a ResultSetNode - this currently means: o Generating a referenced table map for each ResultSetNode. o Putting the WHERE and HAVING clauses in conjunctive normal form (CNF). o Converting the WHERE and HAVING clauses into PredicateLists and classifying them. o Ensuring that a ProjectRestrictNode is generated on top of every FromBaseTable and generated in place of every FromSubquery. o Pushing single table predicates down to the new ProjectRestrictNodes.

Overrides:
preprocess in class ResultSetNode
Parameters:
numTables - The number of tables in the DML Statement
gbl - The group by list, if any
fromList - The from list, if any
Returns:
ResultSetNode at top of preprocessed tree.
Throws:
StandardException - Thrown on error

genProjectRestrict

protected ResultSetNode genProjectRestrict(int numTables)
                                    throws StandardException
Put a ProjectRestrictNode on top of each FromTable in the FromList. ColumnReferences must continue to point to the same ResultColumn, so that ResultColumn must percolate up to the new PRN. However, that ResultColumn will point to a new expression, a VirtualColumnNode, which points to the FromTable and the ResultColumn that is the source for the ColumnReference. (The new PRN will have the original of the ResultColumnList and the ResultColumns from that list. The FromTable will get shallow copies of the ResultColumnList and its ResultColumns. ResultColumn.expression will remain at the FromTable, with the PRN getting a new VirtualColumnNode for each ResultColumn.expression.) We then project out the non-referenced columns. If there are no referenced columns, then the PRN's ResultColumnList will consist of a single ResultColumn whose expression is 1.

Overrides:
genProjectRestrict in class ResultSetNode
Parameters:
numTables - Number of tables in the DML Statement
Returns:
The generated ProjectRestrictNode atop the original FromTable.
Throws:
StandardException - Thrown on error

performMaterialization

public boolean performMaterialization(JBitSet outerTables)
                               throws StandardException
Return whether or not to materialize this ResultSet tree.

Overrides:
performMaterialization in class ResultSetNode
Returns:
Whether or not to materialize this ResultSet tree. would return valid results.
Throws:
StandardException - Thrown on error

generate

public void generate(ActivationClassBuilder acb,
                     MethodBuilder mb)
              throws StandardException
Generation on a FromVTI creates a wrapper around the user's java.sql.ResultSet

Overrides:
generate in class QueryTreeNode
Parameters:
acb - The ActivationClassBuilder for the class being built
mb - The MethodBuilder for the execute() method to be built
Returns:
A compiled Expression that returns a ResultSet that iterates through the user's java.sql.ResultSet.
Throws:
StandardException - Thrown on error

getScanArguments

private int getScanArguments(ActivationClassBuilder acb,
                             MethodBuilder mb)
                      throws StandardException
Throws:
StandardException

generateConstructor

private void generateConstructor(ActivationClassBuilder acb,
                                 MethodBuilder mb,
                                 boolean reuseablePs)
                          throws StandardException
Throws:
StandardException

referencesTarget

public boolean referencesTarget(java.lang.String name,
                                boolean baseTable)
                         throws StandardException
Search to see if a query references the specifed table name.

Overrides:
referencesTarget in class ResultSetNode
Parameters:
name - Table name (String) to search for.
baseTable - Whether or not name is for a base table
Returns:
true if found, else false
Throws:
StandardException - Thrown on error

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
Overrides:
accept in class ResultSetNode
Parameters:
v - the visitor
Throws:
StandardException - on error

getSpecialTriggerVTITableName

private UUID getSpecialTriggerVTITableName(LanguageConnectionContext lcc,
                                           java.lang.String className)
                                    throws StandardException
Check and see if we have a special trigger VTI. If it cannot be bound (because we aren't actually compiling or executing a trigger), then throw an exception.

Returns:
null if not a special trigger vti, or the table id if it is
Throws:
StandardException

genResultColList

private ResultColumnList genResultColList(TableDescriptor td)
                                   throws StandardException
Throws:
StandardException

needsSpecialRCLBinding

public boolean needsSpecialRCLBinding()
Overrides:
needsSpecialRCLBinding in class FromTable

isUpdatableCursor

boolean isUpdatableCursor()
                    throws StandardException
Throws:
StandardException

markUpdatableByCursor

protected void markUpdatableByCursor(java.util.Vector updateColumns)
Description copied from class: FromTable
Mark as updatable all the columns in the result column list of this FromBaseTable that match the columns in the given update column list. If the list is null, it means all the columns are updatable.

Overrides:
markUpdatableByCursor in class FromTable
Parameters:
updateColumns - A Vector representing the columns that can be updated.

getForUpdateColumnList

private int[] getForUpdateColumnList()

isCompileTime

public final boolean isCompileTime()
Description copied from interface: VTIEnvironment
Return true if this instance of the VTI has been created for compilation, false if it is for runtime execution.

Specified by:
isCompileTime in interface VTIEnvironment

getOriginalSQL

public java.lang.String getOriginalSQL()
Description copied from interface: VTIEnvironment
Return the SQL text of the original SQL statement.

Specified by:
getOriginalSQL in interface VTIEnvironment

getStatementIsolationLevel

public final int getStatementIsolationLevel()
Description copied from interface: VTIEnvironment
Get the specific JDBC isolation of the statement. If it returns Connection.TRANSACTION_NONE then no isolation was specified and the connection's isolation level is implied.

Specified by:
getStatementIsolationLevel in interface VTIEnvironment

setSharedState

public void setSharedState(java.lang.String key,
                           java.io.Serializable value)
Description copied from interface: VTIEnvironment
Saves an object associated with a key that will be maintained for the lifetime of the statement plan. Any previous value associated with the key is discarded. Any saved object can be seen by any JDBC Connection that has a Statement object that references the same statement plan.

Specified by:
setSharedState in interface VTIEnvironment

getSharedState

public java.lang.Object getSharedState(java.lang.String key)
Description copied from interface: VTIEnvironment
Get an an object associated with a key from set of objects maintained with the statement plan.

Specified by:
getSharedState in interface VTIEnvironment

Built on Mon 2007-06-04 09:58:47+0400, from revision ???

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