Java Doc for SelectNode.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » sql » compile » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database DBMS » db derby 10.2 » org.apache.derby.impl.sql.compile 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.derby.impl.sql.compile.QueryTreeNode
      org.apache.derby.impl.sql.compile.ResultSetNode
         org.apache.derby.impl.sql.compile.SelectNode

SelectNode
public class SelectNode extends ResultSetNode (Code)
A SelectNode represents the result set for any of the basic DML operations: SELECT, INSERT, UPDATE, and DELETE. (A RowResultSetNode will be used for an INSERT with a VALUES clause.) For INSERT - SELECT, any of the fields in a SelectNode can be used (the SelectNode represents the SELECT statement in the INSERT - SELECT). For UPDATE and DELETE, there will be one table in the fromList, and the groupByList fields will be null. For both INSERT and UPDATE, the resultColumns in the selectList will contain the names of the columns being inserted into or updated.
author:
   Jeff Lichtman


Field Summary
 FromListfromList
    
 GroupByListgroupByList
    
 OrderByListorderByList
    
 booleanorderByQuery
    
 ValueNodeoriginalWhereClause
    
 VectorselectAggregates
    
 SubqueryListselectSubquerys
    
 FromTabletargetTable
    
 VectorwhereAggregates
    
 ValueNodewhereClause
     The ValueNode for the WHERE clause must represent a boolean expression.
 PredicateListwherePredicates
    
 SubqueryListwhereSubquerys
    


Method Summary
public  Visitableaccept(Visitor v)
     Accept a visitor, and call v.visit() on child nodes as necessary.
public  ResultSetNodeaddNewPredicate(Predicate predicate)
     Add a new predicate to the list.
public  voidbindExpressions(FromList fromListParam)
     Bind the expressions in this SelectNode.
public  voidbindExpressionsWithTables(FromList fromListParam)
     Bind the expressions in this ResultSetNode if it has tables.
public  ResultSetNodebindNonVTITables(DataDictionary dataDictionary, FromList fromListParam)
     Bind the tables in this SelectNode.
public  voidbindResultColumns(FromList fromListParam)
     Bind the result columns of this ResultSetNode when there is no base table to bind them to.
public  voidbindResultColumns(TableDescriptor targetTableDescriptor, FromVTI targetVTI, ResultColumnList targetColumnList, DMLStatementNode statement, FromList fromListParam)
     Bind the result columns for this ResultSetNode to a base table. This is useful for INSERT and UPDATE statements, where the result columns get their types from the table being updated or inserted into. If a result column list is specified, then the verification that the result column list does not contain any duplicates will be done when binding them by name.
Parameters:
  targetTableDescriptor - The TableDescriptor for the table beingupdated or inserted into
Parameters:
  targetColumnList - For INSERT statements, the userdoes not have to supply columnnames (for example, "insert into tvalues (1,2,3)".
public  voidbindTargetExpressions(FromList fromListParam)
     Bind the expressions in the target list.
public  voidbindUntypedNullsToResultColumns(ResultColumnList bindingRCL)
     Bind any untyped null nodes to the types in the given ResultColumnList.
public  voidclearDistinct()
    
 voiddecrementLevel(int decrement)
     Decrement (query block) level (0-based) for all of the tables in this ResultSet tree.
public  voiddisablePrivilegeCollection()
    
public  ResultSetNodeensurePredicateList(int numTables)
     Ensure that the top of the RSN tree has a PredicateList.
Parameters:
  numTables - The number of tables in the query.
public  ColumnReferencefindColumnReferenceInResult(String colName)
     Find colName in the result columns and return underlying columnReference. Note that this function returns null if there are more than one FromTable for this SelectNode and the columnReference needs to be directly under the resultColumn.
public  booleanflattenableInFromSubquery(FromList fromList)
     Evaluate whether or not the subquery in a FromSubquery is flattenable.
public  ResultSetNodegenProjectRestrict(int origFromListSize)
     Replace this SelectNode with a ProjectRestrictNode, since it has served its purpose.
Parameters:
  origFromListSize - The size of the original FROM list, beforegeneration of join tree.
public  VectorgetAggregateVector(int clause)
     Return the specified aggregate vector for this SelectNode.
 FromTablegetCursorTargetTable()
     Assumes that isCursorUpdatable has been called, and that it is only called for updatable cursors.
public  CostEstimategetFinalCostEstimate()
     Get the final CostEstimate for this SelectNode.
public  FromListgetFromList()
     Return the fromList for this SelectNode.
protected  FromTablegetFromTableByName(String name, String schemaName, boolean exactMatch)
     Determine whether or not the specified name is an exposed name in the current query block.
Parameters:
  name - The specified name to search for as an exposed name.
Parameters:
  schemaName - Schema name, if non-null.
Parameters:
  exactMatch - Whether or not we need an exact match on specified schema and tablenames or match on table id.
public  booleangetGeneratedForGroupbyClause()
     Return whether or not this SelectNode was generated for a GROUP BY clause.
public  SubqueryListgetSelectSubquerys()
     Return the selectSubquerys for this SelectNode.
public  ValueNodegetWhereClause()
     Return the whereClause for this SelectNode.
public  PredicateListgetWherePredicates()
     Return the wherePredicates for this SelectNode.
public  SubqueryListgetWhereSubquerys()
     Return the whereSubquerys for this SelectNode.
 booleanhasDistinct()
    
public  voidinit(Object selectList, Object aggregateVector, Object fromList, Object whereClause, Object groupByList)
     Initializer for a SelectNode.
 booleanisUpdatableCursor(DataDictionary dd)
     Determine if this select is updatable or not, for a cursor.
public  voidmakeDistinct()
    
public  voidmarkAsForGroupByClause()
     Mark this SelectNode as being generated for a GROUP BY clause.
public  voidmarkAsForHavingClause()
     Mark this SelectNode as being generated for a HAVING clause.
public  ResultSetNodemodifyAccessPaths(PredicateList predList)
     Modify the access paths according to the decisions the optimizer made.
public  ResultSetNodemodifyAccessPaths()
     Modify the access paths according to the choices the optimizer made.
public  ResultSetNodeoptimize(DataDictionary dataDictionary, PredicateList predicateList, double outerRows)
     Optimize this SelectNode.
public  ResultSetNodepreprocess(int numTables, GroupByList gbl, FromList fl)
     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.
public  voidprintSubNodes(int depth)
     Prints the sub-nodes of this object.
 voidpushExpressionsIntoSelect(Predicate predicate)
     Push an expression into this SELECT (and possibly down into one of the tables in the FROM list).
 voidpushOrderByList(OrderByList orderByList)
     Push the order by list down from the cursor node into its child result set so that the optimizer has all of the information that it needs to consider sort avoidance.
public  booleanreferencesSessionSchema()
    
public  booleanreferencesTarget(String name, boolean baseTable)
     Search to see if a query references the specifed table name.
public  voidrejectParameters()
     Check for (and reject) ? parameters directly under the ResultColumns.
 booleanreturnsAtMostOneRow()
     Return whether or not this ResultSet tree is guaranteed to return at most 1 row based on heuristics.
public  StringstatementToString()
    
 booleansubqueryReferencesTarget(String name, boolean baseTable)
     Return whether or not this ResultSetNode contains a subquery with a reference to the specified target table.
Parameters:
  name - The table name.
Parameters:
  baseTable - Whether or not table is a base table.
public  StringtoString()
     Convert this object to a String.
 booleanuniqueSubquery(boolean additionalEQ)
     Determine whether or not this subquery, the SelectNode is in a subquery, can be flattened into the outer query block based on a uniqueness condition. A uniqueness condition exists when we can guarantee that at most 1 row will qualify in each table in the subquery.
public  intupdateTargetLockMode()
     Get the lock mode for the target of an update statement (a delete or update).
public  voidverifySelectStarSubquery(FromList outerFromList, int subqueryType)
     Verify that a SELECT * is valid for this type of subquery.

Field Detail
fromList
FromList fromList(Code)
List of tables in the FROM clause of this SELECT



groupByList
GroupByList groupByList(Code)
List of result columns in GROUP BY clause



orderByList
OrderByList orderByList(Code)



orderByQuery
boolean orderByQuery(Code)



originalWhereClause
ValueNode originalWhereClause(Code)



selectAggregates
Vector selectAggregates(Code)



selectSubquerys
SubqueryList selectSubquerys(Code)



targetTable
FromTable targetTable(Code)



whereAggregates
Vector whereAggregates(Code)



whereClause
ValueNode whereClause(Code)
The ValueNode for the WHERE clause must represent a boolean expression. The binding phase will enforce this - the parser does not have enough information to enforce it in all cases (for example, user methods that return boolean).



wherePredicates
PredicateList wherePredicates(Code)



whereSubquerys
SubqueryList whereSubquerys(Code)





Method Detail
accept
public Visitable accept(Visitor v) throws StandardException(Code)
Accept a visitor, and call v.visit() on child nodes as necessary.
Parameters:
  v - the visitor
exception:
  StandardException - on error



addNewPredicate
public ResultSetNode addNewPredicate(Predicate predicate) throws StandardException(Code)
Add a new predicate to the list. This is useful when doing subquery transformations, when we build a new predicate with the left side of the subquery operator and the subquery's result column.
Parameters:
  predicate - The predicate to add ResultSetNode The new top of the tree.
exception:
  StandardException - Thrown on error



bindExpressions
public void bindExpressions(FromList fromListParam) throws StandardException(Code)
Bind the expressions in this SelectNode. This means binding the sub-expressions, as well as figuring out what the return type is for each expression.
Parameters:
  fromListParam - FromList to use/append to.
exception:
  StandardException - Thrown on error



bindExpressionsWithTables
public void bindExpressionsWithTables(FromList fromListParam) throws StandardException(Code)
Bind the expressions in this ResultSetNode if it has tables. This means binding the sub-expressions, as well as figuring out what the return type is for each expression.
Parameters:
  fromListParam - FromList to use/append to.
exception:
  StandardException - Thrown on error



bindNonVTITables
public ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException(Code)
Bind the tables in this SelectNode. This includes getting their TableDescriptors from the DataDictionary and numbering the FromTables. NOTE: Because this node represents the top of a new query block, we bind both the non VTI and VTI tables under this node in this method call.
Parameters:
  dataDictionary - The DataDictionary to use for binding
Parameters:
  fromListParam - FromList to use/append to. ResultSetNode
exception:
  StandardException - Thrown on error



bindResultColumns
public void bindResultColumns(FromList fromListParam) throws StandardException(Code)
Bind the result columns of this ResultSetNode when there is no base table to bind them to. This is useful for SELECT statements, where the result columns get their types from the expressions that live under them.
Parameters:
  fromListParam - FromList to use/append to.
exception:
  StandardException - Thrown on error



bindResultColumns
public void bindResultColumns(TableDescriptor targetTableDescriptor, FromVTI targetVTI, ResultColumnList targetColumnList, DMLStatementNode statement, FromList fromListParam) throws StandardException(Code)
Bind the result columns for this ResultSetNode to a base table. This is useful for INSERT and UPDATE statements, where the result columns get their types from the table being updated or inserted into. If a result column list is specified, then the verification that the result column list does not contain any duplicates will be done when binding them by name.
Parameters:
  targetTableDescriptor - The TableDescriptor for the table beingupdated or inserted into
Parameters:
  targetColumnList - For INSERT statements, the userdoes not have to supply columnnames (for example, "insert into tvalues (1,2,3)". When thisparameter is null, it means thatthe user did not supply columnnames, and so the binding shouldbe done based on order. When itis not null, it means do the bindingby name, not position.
Parameters:
  statement - Calling DMLStatementNode (Insert or Update)
Parameters:
  fromListParam - FromList to use/append to.
exception:
  StandardException - Thrown on error



bindTargetExpressions
public void bindTargetExpressions(FromList fromListParam) throws StandardException(Code)
Bind the expressions in the target list. This means binding the sub-expressions, as well as figuring out what the return type is for each expression. This is useful for EXISTS subqueries, where we need to validate the target list before blowing it away and replacing it with a SELECT true.
exception:
  StandardException - Thrown on error



bindUntypedNullsToResultColumns
public void bindUntypedNullsToResultColumns(ResultColumnList bindingRCL) throws StandardException(Code)
Bind any untyped null nodes to the types in the given ResultColumnList.
Parameters:
  bindingRCL - The ResultColumnList with the types to bind to.
exception:
  StandardException - Thrown on error



clearDistinct
public void clearDistinct()(Code)



decrementLevel
void decrementLevel(int decrement)(Code)
Decrement (query block) level (0-based) for all of the tables in this ResultSet tree. This is useful when flattening a subquery.
Parameters:
  decrement - The amount to decrement by.



disablePrivilegeCollection
public void disablePrivilegeCollection()(Code)

See Also:   QueryTreeNode.disablePrivilegeCollection



ensurePredicateList
public ResultSetNode ensurePredicateList(int numTables) throws StandardException(Code)
Ensure that the top of the RSN tree has a PredicateList.
Parameters:
  numTables - The number of tables in the query. ResultSetNode A RSN tree with a node which has a PredicateList on top.
exception:
  StandardException - Thrown on error



findColumnReferenceInResult
public ColumnReference findColumnReferenceInResult(String colName) throws StandardException(Code)
Find colName in the result columns and return underlying columnReference. Note that this function returns null if there are more than one FromTable for this SelectNode and the columnReference needs to be directly under the resultColumn. So having an expression under the resultSet would cause returning null.
Parameters:
  colName - Name of the column ColumnReference ColumnReference to the column, if found



flattenableInFromSubquery
public boolean flattenableInFromSubquery(FromList fromList)(Code)
Evaluate whether or not the subquery in a FromSubquery is flattenable. Currently, a FSqry is flattenable if all of the following are true: o Subquery is a SelectNode. (ie, not a RowResultSetNode or a UnionNode) o It contains a single table in its FROM list. o It contains no subqueries in the SELECT list. o It does not contain a group by or having clause o It does not contain aggregates. o It is not a DISTINCT.
Parameters:
  fromList - The outer from list boolean Whether or not the FromSubquery is flattenable.



genProjectRestrict
public ResultSetNode genProjectRestrict(int origFromListSize) throws StandardException(Code)
Replace this SelectNode with a ProjectRestrictNode, since it has served its purpose.
Parameters:
  origFromListSize - The size of the original FROM list, beforegeneration of join tree. ResultSetNode new ResultSetNode atop the query tree.
exception:
  StandardException - Thrown on error



getAggregateVector
public Vector getAggregateVector(int clause)(Code)
Return the specified aggregate vector for this SelectNode.
Parameters:
  clause - Which clause to get the aggregate list for aggregateVector The specified aggregate vector for this SelectNode.



getCursorTargetTable
FromTable getCursorTargetTable()(Code)
Assumes that isCursorUpdatable has been called, and that it is only called for updatable cursors.



getFinalCostEstimate
public CostEstimate getFinalCostEstimate() throws StandardException(Code)
Get the final CostEstimate for this SelectNode. The final CostEstimate for this SelectNode, which isthe final cost estimate for the best join order ofthis SelectNode's optimizer.



getFromList
public FromList getFromList()(Code)
Return the fromList for this SelectNode. FromList The fromList for this SelectNode.



getFromTableByName
protected FromTable getFromTableByName(String name, String schemaName, boolean exactMatch) throws StandardException(Code)
Determine whether or not the specified name is an exposed name in the current query block.
Parameters:
  name - The specified name to search for as an exposed name.
Parameters:
  schemaName - Schema name, if non-null.
Parameters:
  exactMatch - Whether or not we need an exact match on specified schema and tablenames or match on table id. The FromTable, if any, with the exposed name.
exception:
  StandardException - Thrown on error



getGeneratedForGroupbyClause
public boolean getGeneratedForGroupbyClause()(Code)
Return whether or not this SelectNode was generated for a GROUP BY clause. boolean Whether or not this SelectNode was generated for a GROUP BY clause.



getSelectSubquerys
public SubqueryList getSelectSubquerys()(Code)
Return the selectSubquerys for this SelectNode. SubqueryList The selectSubquerys for this SelectNode.



getWhereClause
public ValueNode getWhereClause()(Code)
Return the whereClause for this SelectNode. ValueNode The whereClause for this SelectNode.



getWherePredicates
public PredicateList getWherePredicates()(Code)
Return the wherePredicates for this SelectNode. PredicateList The wherePredicates for this SelectNode.



getWhereSubquerys
public SubqueryList getWhereSubquerys()(Code)
Return the whereSubquerys for this SelectNode. SubqueryList The whereSubquerys for this SelectNode.



hasDistinct
boolean hasDistinct()(Code)



init
public void init(Object selectList, Object aggregateVector, Object fromList, Object whereClause, Object groupByList) throws StandardException(Code)
Initializer for a SelectNode.
Parameters:
  selectList - The result column list for the SELECT statement
Parameters:
  aggregateVector - The aggregate vector for this SELECT
Parameters:
  fromList - The FROM list for the SELECT statement
Parameters:
  whereClause - An expression representing the WHERE clause.It must be a boolean expression, but this isnot checked until binding.
Parameters:
  groupByList - The GROUP BY list, if any.
exception:
  StandardException - Thrown on error



isUpdatableCursor
boolean isUpdatableCursor(DataDictionary dd) throws StandardException(Code)
Determine if this select is updatable or not, for a cursor.



makeDistinct
public void makeDistinct()(Code)



markAsForGroupByClause
public void markAsForGroupByClause()(Code)
Mark this SelectNode as being generated for a GROUP BY clause.



markAsForHavingClause
public void markAsForHavingClause()(Code)
Mark this SelectNode as being generated for a HAVING clause.



modifyAccessPaths
public ResultSetNode modifyAccessPaths(PredicateList predList) throws StandardException(Code)
Modify the access paths according to the decisions the optimizer made. This can include adding project/restrict nodes, index-to-base-row nodes, etc.
Parameters:
  predList - A list of optimizable predicates that shouldbe pushed to this ResultSetNode, as determined by optimizer. The modified query tree
exception:
  StandardException - Thrown on error



modifyAccessPaths
public ResultSetNode modifyAccessPaths() throws StandardException(Code)
Modify the access paths according to the choices the optimizer made. A QueryTree with the necessary modifications made
exception:
  StandardException - Thrown on error



optimize
public ResultSetNode optimize(DataDictionary dataDictionary, PredicateList predicateList, double outerRows) throws StandardException(Code)
Optimize this SelectNode. This means choosing the best access path for each table, among other things.
Parameters:
  dataDictionary - The DataDictionary to use for optimization
Parameters:
  predicateList - The predicate list to optimize against
Parameters:
  outerRows - The number of outer joining rows ResultSetNode The top of the optimized tree
exception:
  StandardException - Thrown on error



preprocess
public ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fl) throws StandardException(Code)
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.
Parameters:
  numTables - The number of tables in the DML Statement
Parameters:
  gbl - The outer group by list, if any
Parameters:
  fl - The from list, if any The generated ProjectRestrictNode atop the original FromTable.
exception:
  StandardException - Thrown on error



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



pushExpressionsIntoSelect
void pushExpressionsIntoSelect(Predicate predicate) throws StandardException(Code)
Push an expression into this SELECT (and possibly down into one of the tables in the FROM list). This is useful when trying to push predicates into unflattened views or derived tables.
Parameters:
  predicate - The predicate that we attempt to push
exception:
  StandardException - Thrown on error



pushOrderByList
void pushOrderByList(OrderByList orderByList)(Code)
Push the order by list down from the cursor node into its child result set so that the optimizer has all of the information that it needs to consider sort avoidance.
Parameters:
  orderByList - The order by list



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



referencesTarget
public boolean referencesTarget(String name, boolean baseTable) throws StandardException(Code)
Search to see if a query references the specifed table name.
Parameters:
  name - Table name (String) to search for.
Parameters:
  baseTable - Whether or not name is for a base table true if found, else false
exception:
  StandardException - Thrown on error



rejectParameters
public void rejectParameters() throws StandardException(Code)
Check for (and reject) ? parameters directly under the ResultColumns. This is done for SELECT statements.
exception:
  StandardException - Thrown if a ? parameter founddirectly under a ResultColumn



returnsAtMostOneRow
boolean returnsAtMostOneRow()(Code)
Return whether or not this ResultSet tree is guaranteed to return at most 1 row based on heuristics. (A RowResultSetNode and a SELECT with a non-grouped aggregate will return at most 1 row.) Whether or not this ResultSet tree is guaranteed to returnat most 1 row based on heuristics.



statementToString
public String statementToString()(Code)



subqueryReferencesTarget
boolean subqueryReferencesTarget(String name, boolean baseTable) throws StandardException(Code)
Return whether or not this ResultSetNode contains a subquery with a reference to the specified target table.
Parameters:
  name - The table name.
Parameters:
  baseTable - Whether or not table is a base table. boolean Whether or not a reference to the table was found.
exception:
  StandardException - Thrown on error



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



uniqueSubquery
boolean uniqueSubquery(boolean additionalEQ) throws StandardException(Code)
Determine whether or not this subquery, the SelectNode is in a subquery, can be flattened into the outer query block based on a uniqueness condition. A uniqueness condition exists when we can guarantee that at most 1 row will qualify in each table in the subquery. This is true if every table in the from list is (a base table and the set of columns from the table that are in equality comparisons with expressions that do not include a column from the same table is a superset of any unique index on the table) or an ExistsBaseTable.
Parameters:
  additionalEQ - Whether or not the column returnedby this select, if it is a ColumnReference,is in an equality comparison. Whether or not this subquery can be flattened basedon a uniqueness condition.
exception:
  StandardException - Thrown on error



updateTargetLockMode
public int updateTargetLockMode()(Code)
Get the lock mode for the target of an update statement (a delete or update). The update mode will always be row for CurrentOfNodes. It will be table if there is no where clause.
See Also:   TransactionController The lock mode



verifySelectStarSubquery
public void verifySelectStarSubquery(FromList outerFromList, int subqueryType) throws StandardException(Code)
Verify that a SELECT * is valid for this type of subquery.
Parameters:
  outerFromList - The FromList from the outer query block(s)
Parameters:
  subqueryType - The subquery type
exception:
  StandardException - Thrown on error



Fields inherited from org.apache.derby.impl.sql.compile.ResultSetNode
CostEstimate costEstimate(Code)(Java Doc)
boolean cursorTargetTable(Code)(Java Doc)
CostEstimate finalCostEstimate(Code)(Java Doc)
boolean insertSource(Code)(Java Doc)
Optimizer optimizer(Code)(Java Doc)
JBitSet referencedTableMap(Code)(Java Doc)
ResultColumnList resultColumns(Code)(Java Doc)
int resultSetNumber(Code)(Java Doc)
CostEstimate scratchCostEstimate(Code)(Java Doc)
boolean statementResultSet(Code)(Java Doc)

Methods inherited from org.apache.derby.impl.sql.compile.ResultSetNode
public JBitSet LOJgetReferencedTables(int numTables) throws StandardException(Code)(Java Doc)
public Visitable accept(Visitor v) throws StandardException(Code)(Java Doc)
public ResultSetNode addNewPredicate(Predicate predicate) throws StandardException(Code)(Java Doc)
public void assignResultSetNumber() throws StandardException(Code)(Java Doc)
public void bindExpressions(FromList fromListParam) throws StandardException(Code)(Java Doc)
public void bindExpressionsWithTables(FromList fromListParam) throws StandardException(Code)(Java Doc)
public ResultSetNode bindNonVTITables(DataDictionary dataDictionary, FromList fromListParam) throws StandardException(Code)(Java Doc)
public void bindResultColumns(FromList fromListParam) throws StandardException(Code)(Java Doc)
public void bindResultColumns(TableDescriptor targetTableDescriptor, FromVTI targetVTI, ResultColumnList targetColumnList, DMLStatementNode statement, FromList fromListParam) throws StandardException(Code)(Java Doc)
public void bindTargetExpressions(FromList fromListParam) throws StandardException(Code)(Java Doc)
public void bindUntypedNullsToResultColumns(ResultColumnList rcl) throws StandardException(Code)(Java Doc)
public ResultSetNode bindVTITables(FromList fromListParam) throws StandardException(Code)(Java Doc)
public ResultSetNode changeAccessPath() throws StandardException(Code)(Java Doc)
boolean columnTypesAndLengthsMatch() throws StandardException(Code)(Java Doc)
public ResultSetNode considerMaterialization(JBitSet outerTables) throws StandardException(Code)(Java Doc)
abstract void decrementLevel(int decrement)(Code)(Java Doc)
public void disablePrivilegeCollection()(Code)(Java Doc)
public ResultSetNode enhanceRCLForInsert(int numTargetColumns, int[] colMap, DataDictionary dataDictionary, TableDescriptor targetTD, FromVTI targetVTI) throws StandardException(Code)(Java Doc)
public ResultSetNode ensurePredicateList(int numTables) throws StandardException(Code)(Java Doc)
public void fillInReferencedTableMap(JBitSet passedMap)(Code)(Java Doc)
public boolean flattenableInFromSubquery(FromList fromList)(Code)(Java Doc)
ResultColumn genNewRCForInsert(TableDescriptor targetTD, FromVTI targetVTI, int columnNumber, DataDictionary dataDictionary) throws StandardException(Code)(Java Doc)
public NormalizeResultSetNode genNormalizeResultSetNode(ResultSetNode normalizeChild, boolean forUpdate) throws StandardException(Code)(Java Doc)
public ResultSetNode genProjectRestrict() throws StandardException(Code)(Java Doc)
protected ResultSetNode genProjectRestrict(int numTables) throws StandardException(Code)(Java Doc)
ResultSetNode genProjectRestrictForReordering() throws StandardException(Code)(Java Doc)
public void generateNormalizationResultSet(ActivationClassBuilder acb, MethodBuilder mb, int resultSetNumber, ResultDescription resultDescription) throws StandardException(Code)(Java Doc)
public void generateResultSet(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc)
public ResultColumnList getAllResultColumns(TableName allTableName) throws StandardException(Code)(Java Doc)
public CostEstimate getCostEstimate()(Code)(Java Doc)
FromTable getCursorTargetTable()(Code)(Java Doc)
public CostEstimate getFinalCostEstimate() throws StandardException(Code)(Java Doc)
public FromList getFromList() throws StandardException(Code)(Java Doc)
protected FromTable getFromTableByName(String name, String schemaName, boolean exactMatch) throws StandardException(Code)(Java Doc)
public ResultColumn getMatchingColumn(ColumnReference columnReference) throws StandardException(Code)(Java Doc)
protected CostEstimate getNewCostEstimate() throws StandardException(Code)(Java Doc)
protected Optimizer getOptimizer(OptimizableList optList, OptimizablePredicateList predList, DataDictionary dataDictionary, RequiredRowOrdering requiredRowOrdering) throws StandardException(Code)(Java Doc)
protected OptimizerImpl getOptimizerImpl()(Code)(Java Doc)
public JBitSet getReferencedTableMap()(Code)(Java Doc)
public ResultColumnList getResultColumns()(Code)(Java Doc)
public int getResultSetNumber()(Code)(Java Doc)
public boolean isNotExists()(Code)(Java Doc)
public boolean isOneRowResultSet() throws StandardException(Code)(Java Doc)
boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, Vector fbtVector) throws StandardException(Code)(Java Doc)
boolean isPossibleDistinctScan(Set distinctColumns)(Code)(Java Doc)
boolean isUpdatableCursor(DataDictionary dd) throws StandardException(Code)(Java Doc)
public ResultDescription makeResultDescription()(Code)(Java Doc)
ResultColumnDescriptor[] makeResultDescriptors(ExecutionContext ec)(Code)(Java Doc)
public boolean markAsCursorTargetTable()(Code)(Java Doc)
void markForDistinctScan()(Code)(Java Doc)
void markOrderingDependent()(Code)(Java Doc)
public void markStatementResultSet()(Code)(Java Doc)
public ResultSetNode modifyAccessPaths() throws StandardException(Code)(Java Doc)
public ResultSetNode modifyAccessPaths(PredicateList predList) throws StandardException(Code)(Java Doc)
void notCursorTargetTable()(Code)(Java Doc)
void notFlattenableJoin()(Code)(Java Doc)
final protected static int numDistinctAggregates(Vector aggregateVector)(Code)(Java Doc)
public ResultSetNode optimize(DataDictionary dataDictionary, PredicateList predicates, double outerRows) throws StandardException(Code)(Java Doc)
public ValueNode parseDefault(String defaultText) throws StandardException(Code)(Java Doc)
public boolean performMaterialization(JBitSet outerTables) throws StandardException(Code)(Java Doc)
public ResultSetNode preprocess(int numTables, GroupByList gbl, FromList fromList) throws StandardException(Code)(Java Doc)
public void printSubNodes(int depth)(Code)(Java Doc)
void projectResultColumns() throws StandardException(Code)(Java Doc)
void pushOrderByList(OrderByList orderByList)(Code)(Java Doc)
public boolean referencesTarget(String name, boolean baseTable) throws StandardException(Code)(Java Doc)
public void rejectParameters() throws StandardException(Code)(Java Doc)
public void rejectXMLValues() throws StandardException(Code)(Java Doc)
public void renameGeneratedResultNames() throws StandardException(Code)(Java Doc)
void replaceDefaults(TableDescriptor ttd, ResultColumnList tcl) throws StandardException(Code)(Java Doc)
boolean returnsAtMostOneRow()(Code)(Java Doc)
public void setInsertSource()(Code)(Java Doc)
public void setReferencedTableMap(JBitSet newRTM)(Code)(Java Doc)
public void setResultColumns(ResultColumnList newRCL)(Code)(Java Doc)
public void setResultToBooleanTrueNode(boolean onlyConvertAlls) throws StandardException(Code)(Java Doc)
void setTableConstructorTypes(ResultColumnList typeColumns) throws StandardException(Code)(Java Doc)
boolean subqueryReferencesTarget(String name, boolean baseTable) throws StandardException(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public int updateTargetLockMode()(Code)(Java Doc)
public void verifySelectStarSubquery(FromList outerFromList, int subqueryType) throws StandardException(Code)(Java Doc)

Fields inherited from org.apache.derby.impl.sql.compile.QueryTreeNode
final public static int AUTOINCREMENT_CREATE_MODIFY(Code)(Java Doc)
final public static int AUTOINCREMENT_INC_INDEX(Code)(Java Doc)
final public static int AUTOINCREMENT_IS_AUTOINCREMENT_INDEX(Code)(Java Doc)
final public static int AUTOINCREMENT_START_INDEX(Code)(Java Doc)
boolean isPrivilegeCollectionRequired(Code)(Java Doc)

Methods inherited from org.apache.derby.impl.sql.compile.QueryTreeNode
public Visitable accept(Visitor v) throws StandardException(Code)(Java Doc)
public QueryTreeNode bind() throws StandardException(Code)(Java Doc)
public DataValueDescriptor convertDefaultNode(DataTypeDescriptor typeDescriptor) throws StandardException(Code)(Java Doc)
protected static void debugFlush()(Code)(Java Doc)
public static void debugPrint(String outputString)(Code)(Java Doc)
public void disablePrivilegeCollection()(Code)(Java Doc)
public String executeSchemaName()(Code)(Java Doc)
public String executeStatementName()(Code)(Java Doc)
public static String formatNodeString(String nodeString, int depth)(Code)(Java Doc)
public boolean foundString(String[] list, String search)(Code)(Java Doc)
public GeneratedClass generate(ByteArray ignored) throws StandardException(Code)(Java Doc)
protected void generate(ActivationClassBuilder acb, MethodBuilder mb) throws StandardException(Code)(Java Doc)
void generateAuthorizeCheck(ActivationClassBuilder acb, MethodBuilder mb, int sqlOperation)(Code)(Java Doc)
public int getBeginOffset()(Code)(Java Doc)
final protected ClassFactory getClassFactory()(Code)(Java Doc)
final protected CompilerContext getCompilerContext()(Code)(Java Doc)
final public ContextManager getContextManager()(Code)(Java Doc)
public Object getCursorInfo() throws StandardException(Code)(Java Doc)
final public DataDictionary getDataDictionary()(Code)(Java Doc)
final public DependencyManager getDependencyManager()(Code)(Java Doc)
public int getEndOffset()(Code)(Java Doc)
final public ExecutionFactory getExecutionFactory()(Code)(Java Doc)
final public GenericConstantActionFactory getGenericConstantActionFactory()(Code)(Java Doc)
protected int getIntProperty(String value, String key) throws StandardException(Code)(Java Doc)
final protected LanguageConnectionContext getLanguageConnectionContext()(Code)(Java Doc)
final public NodeFactory getNodeFactory()(Code)(Java Doc)
protected int getNodeType()(Code)(Java Doc)
public ConstantNode getNullNode(TypeId typeId, ContextManager cm) throws StandardException(Code)(Java Doc)
public DataTypeDescriptor[] getParameterTypes() throws StandardException(Code)(Java Doc)
public long getRowEstimate()(Code)(Java Doc)
public String getSPSName()(Code)(Java Doc)
final SchemaDescriptor getSchemaDescriptor(String schemaName) throws StandardException(Code)(Java Doc)
final SchemaDescriptor getSchemaDescriptor(String schemaName, boolean raiseError) throws StandardException(Code)(Java Doc)
protected int getStatementType()(Code)(Java Doc)
final protected TableDescriptor getTableDescriptor(String tableName, SchemaDescriptor schema) throws StandardException(Code)(Java Doc)
final protected TypeCompiler getTypeCompiler(TypeId typeId)(Code)(Java Doc)
public void init(Object arg1) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13) throws StandardException(Code)(Java Doc)
public void init(Object arg1, Object arg2, Object arg3, Object arg4, Object arg5, Object arg6, Object arg7, Object arg8, Object arg9, Object arg10, Object arg11, Object arg12, Object arg13, Object arg14) throws StandardException(Code)(Java Doc)
public boolean isAtomic() throws StandardException(Code)(Java Doc)
protected boolean isInstanceOf(int nodeType)(Code)(Java Doc)
public boolean isPrivilegeCollectionRequired()(Code)(Java Doc)
final boolean isSessionSchema(SchemaDescriptor sd)(Code)(Java Doc)
final boolean isSessionSchema(String schemaName)(Code)(Java Doc)
public ConstantAction makeConstantAction() throws StandardException(Code)(Java Doc)
public ResultDescription makeResultDescription() throws StandardException(Code)(Java Doc)
public TableName makeTableName(String schemaName, String flatName) throws StandardException(Code)(Java Doc)
public boolean needsSavepoint()(Code)(Java Doc)
protected String nodeHeader()(Code)(Java Doc)
public QueryTreeNode optimize() throws StandardException(Code)(Java Doc)
public static QueryTreeNode parseQueryText(CompilerContext compilerContext, String queryText, Object[] paramDefaults, LanguageConnectionContext lcc) throws StandardException(Code)(Java Doc)
public void printLabel(int depth, String label)(Code)(Java Doc)
public void printSubNodes(int depth)(Code)(Java Doc)
public boolean referencesSessionSchema() throws StandardException(Code)(Java Doc)
public TableName resolveTableToSynonym(TableName tabName) throws StandardException(Code)(Java Doc)
public void setBeginOffset(int beginOffset)(Code)(Java Doc)
public void setContextManager(ContextManager cm)(Code)(Java Doc)
public void setEndOffset(int endOffset)(Code)(Java Doc)
public void setNodeType(int nodeType)(Code)(Java Doc)
public void setRefActionInfo(long fkIndexConglomId, int[] fkColArray, String parentResultSetId, boolean dependentScan)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public void treePrint()(Code)(Java Doc)
public void treePrint(int depth)(Code)(Java Doc)
String verifyClassExist(String javaClassName, boolean convertCase) throws StandardException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.