Java Doc for RelationalOperator.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) 


org.apache.derby.impl.sql.compile.RelationalOperator

All known Subclasses:   org.apache.derby.impl.sql.compile.BinaryRelationalOperatorNode,  org.apache.derby.impl.sql.compile.IsNullNode,
RelationalOperator
public interface RelationalOperator (Code)
This interface is an abstraction of a relational operator. It was created for optimization, to allow binary comparison operators and IS NULL to be treated the same.


Field Summary
final public  intEQUALS_RELOP
    
final public  intGREATER_EQUALS_RELOP
    
final public  intGREATER_THAN_RELOP
    
final public  intIS_NOT_NULL_RELOP
    
final public  intIS_NULL_RELOP
    
final public  intLESS_EQUALS_RELOP
    
final public  intLESS_THAN_RELOP
    
final public  intNOT_EQUALS_RELOP
    


Method Summary
public  booleancompareWithKnownConstant(Optimizable optTable, boolean considerParameters)
     Return whether this operator compares the given Optimizable with a constant whose value is known at compile time.
public  booleanequalsComparisonWithConstantExpression(Optimizable optTable)
     Return whether this operator is an equality comparison of the given optimizable with a constant expression.
 voidgenerateAbsoluteColumnId(MethodBuilder mb, Optimizable optTable)
     Generate the absolute column id for the ColumnReference that appears on one side of this RelationalOperator or the other, and that refers to the given table.
 voidgenerateExpressionOperand(Optimizable optTable, int columnPosition, ExpressionClassBuilder acb, MethodBuilder mb)
     Check whether this RelationalOperator is a comparison of the given column with an expression.
 voidgenerateNegate(MethodBuilder mb, Optimizable optTable)
     Generate an expression that evaluates to true if the result of the comparison should be negated.
 voidgenerateOperator(MethodBuilder mb, Optimizable optTable)
     Generate the comparison operator for this RelationalOperator.
 voidgenerateOrderedNulls(MethodBuilder mb)
     Generate an expression that evaluates to true if this RelationalOperator uses ordered null semantics, false if it doesn't.
 voidgenerateQualMethod(ExpressionClassBuilder acb, MethodBuilder mb, Optimizable optTable)
     Generate the method to evaluate a Qualifier.
 voidgenerateRelativeColumnId(MethodBuilder mb, Optimizable optTable)
     Generate the relative column id for the ColumnReference that appears on one side of this RelationalOperator or the other, and that refers to the given table.
 ColumnReferencegetColumnOperand(Optimizable optTable, int columnPosition)
     Check whether this RelationalOperator is a comparison of the given column with an expression.
 ColumnReferencegetColumnOperand(Optimizable optTable)
     Get the ColumnReference for the given table on one side of this RelationalOperator.
public  DataValueDescriptorgetCompareValue(Optimizable optTable)
     Return an Object representing the known value that this relational operator is comparing to a column in the given Optimizable.
 ValueNodegetExpressionOperand(int tableNumber, int columnPosition, FromTable ft)
     Check whether this RelationalOperator is a comparison of the given column with an expression.
 ValueNodegetOperand(ColumnReference cRef, int refSetSize, boolean otherSide)
     Find the operand (left or right) that points to the same table as the received ColumnReference, and then return either that operand or the "other" operand, depending on the value of otherSide.
public  intgetOperator()
     Return the operator (as an int) for this RelationalOperator.
public  intgetOrderableVariantType(Optimizable optTable)
     Return the variant type for the Qualifier's Orderable.
 intgetStartOperator(Optimizable optTable)
     Get the start operator for a scan (at the store level) for this RelationalOperator.
 intgetStopOperator(Optimizable optTable)
     Get the stop operator for a scan (at the store level) for this RelationalOperator.
public  RelationalOperatorgetTransitiveSearchClause(ColumnReference otherCR)
     Return a relational operator which matches the current one but with the passed in ColumnReference as the (left) operand.
 booleanisQualifier(Optimizable optTable, boolean forPush)
     Return true if this operator can be compiled into a Qualifier for the given Optimizable table.
 booleanorderedNulls()
    
 booleanselfComparison(ColumnReference cr)
     Check whether this RelationalOperator compares the given ColumnReference to any columns in the same table as the ColumnReference.
 booleanusefulStartKey(Optimizable optTable)
     Tell whether this relop is a useful start key for the given table.
 booleanusefulStopKey(Optimizable optTable)
     Tell whether this relop is a useful stop key for the given table.

Field Detail
EQUALS_RELOP
final public int EQUALS_RELOP(Code)



GREATER_EQUALS_RELOP
final public int GREATER_EQUALS_RELOP(Code)



GREATER_THAN_RELOP
final public int GREATER_THAN_RELOP(Code)



IS_NOT_NULL_RELOP
final public int IS_NOT_NULL_RELOP(Code)



IS_NULL_RELOP
final public int IS_NULL_RELOP(Code)



LESS_EQUALS_RELOP
final public int LESS_EQUALS_RELOP(Code)



LESS_THAN_RELOP
final public int LESS_THAN_RELOP(Code)



NOT_EQUALS_RELOP
final public int NOT_EQUALS_RELOP(Code)





Method Detail
compareWithKnownConstant
public boolean compareWithKnownConstant(Optimizable optTable, boolean considerParameters)(Code)
Return whether this operator compares the given Optimizable with a constant whose value is known at compile time.



equalsComparisonWithConstantExpression
public boolean equalsComparisonWithConstantExpression(Optimizable optTable)(Code)
Return whether this operator is an equality comparison of the given optimizable with a constant expression.



generateAbsoluteColumnId
void generateAbsoluteColumnId(MethodBuilder mb, Optimizable optTable)(Code)
Generate the absolute column id for the ColumnReference that appears on one side of this RelationalOperator or the other, and that refers to the given table. (Absolute column id means column id within the row stored on disk.)
Parameters:
  mb - The method the generated code is to go into
Parameters:
  optTable - The optimizable table we're doing the scan on.



generateExpressionOperand
void generateExpressionOperand(Optimizable optTable, int columnPosition, ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException(Code)
Check whether this RelationalOperator is a comparison of the given column with an expression. If so, generate the Expression for the ValueNode that the column is being compared to.
Parameters:
  optTable - An Optimizable for the base table the column is in
Parameters:
  columnPosition - The ordinal position of the column (one-based)
Parameters:
  acb - The ExpressionClassBuilder for the class we're building
Parameters:
  mb - The method the expression will go into
exception:
  StandardException - Thrown on error



generateNegate
void generateNegate(MethodBuilder mb, Optimizable optTable)(Code)
Generate an expression that evaluates to true if the result of the comparison should be negated. For example, col > 1 generates a comparison operator of <= and a negation of true, while col < 1 generates a comparison operator of < and a negation of false.
Parameters:
  mb - The method the generated code is to go into
Parameters:
  optTable - The Optimizable table the Qualifier will qualify



generateOperator
void generateOperator(MethodBuilder mb, Optimizable optTable)(Code)
Generate the comparison operator for this RelationalOperator. The operator can depend on which side of this operator the optimizable column is.
Parameters:
  mb - The method the generated code is to go into
Parameters:
  optTable - The optimizable table we're doing the scan on.



generateOrderedNulls
void generateOrderedNulls(MethodBuilder mb)(Code)
Generate an expression that evaluates to true if this RelationalOperator uses ordered null semantics, false if it doesn't.
Parameters:
  mb - The method the generated code is to go into



generateQualMethod
void generateQualMethod(ExpressionClassBuilder acb, MethodBuilder mb, Optimizable optTable) throws StandardException(Code)
Generate the method to evaluate a Qualifier. The factory method for a Qualifier takes a GeneratedMethod that returns the Orderable that Qualifier.getOrderable() returns.
Parameters:
  acb - The ExpressionClassBuilder for the class we're building
Parameters:
  mb - The method the generated code is to go into
Parameters:
  optTable - The Optimizable table the Qualifier will qualify
exception:
  StandardException - Thrown on error.



generateRelativeColumnId
void generateRelativeColumnId(MethodBuilder mb, Optimizable optTable)(Code)
Generate the relative column id for the ColumnReference that appears on one side of this RelationalOperator or the other, and that refers to the given table. (Relative column id means column id within the partial row returned by the store.)
Parameters:
  mb - The method the generated code is to go into
Parameters:
  optTable - The optimizable table we're doing the scan on.



getColumnOperand
ColumnReference getColumnOperand(Optimizable optTable, int columnPosition)(Code)
Check whether this RelationalOperator is a comparison of the given column with an expression. If so, return the ColumnReference that corresponds to the given column, and that is on one side of this RelationalOperator or the other (this method copes with the column being on either side of the operator). If the given column does not appear by itself on one side of the comparison, the method returns null.
Parameters:
  optTable - An Optimizable for the base table the column is in
Parameters:
  columnPosition - The ordinal position of the column (one-based) The ColumnReference on one side of this RelationalOperatorthat represents the given columnPosition. Returns nullif no such ColumnReference exists by itself on one side ofthis RelationalOperator.



getColumnOperand
ColumnReference getColumnOperand(Optimizable optTable)(Code)
Get the ColumnReference for the given table on one side of this RelationalOperator. This presumes it will be found only on one side. If not found, it will return null.



getCompareValue
public DataValueDescriptor getCompareValue(Optimizable optTable) throws StandardException(Code)
Return an Object representing the known value that this relational operator is comparing to a column in the given Optimizable.
exception:
  StandardException - Thrown on error



getExpressionOperand
ValueNode getExpressionOperand(int tableNumber, int columnPosition, FromTable ft)(Code)
Check whether this RelationalOperator is a comparison of the given column with an expression. If so, return the expression the column is being compared to.
Parameters:
  tableNumber - The table number of the base table the column is in
Parameters:
  columnPosition - The ordinal position of the column (one-based)
Parameters:
  ft - We'll look for the column in all tables at and beneath ft.This is useful if ft is, say, a ProjectRestrictNode over a subquery--then we want to look at all of the FROM tables in the subquery to tryto find the right column. The ValueNode for the expression the column is being comparedto - null if the column is not being compared to anything.



getOperand
ValueNode getOperand(ColumnReference cRef, int refSetSize, boolean otherSide)(Code)
Find the operand (left or right) that points to the same table as the received ColumnReference, and then return either that operand or the "other" operand, depending on the value of otherSide. This presumes it will be found only on one side. If not found, it will return null.
Parameters:
  cRef - The ColumnReference for which we're searching.
Parameters:
  refSetSize - Size of the referenced map for the predicaterepresented by this RelationalOperator node. This is usedfor storing base table numbers when searching for cRef.
Parameters:
  otherSide - Assuming we find an operand that points tothe same table as cRef, then we will return the *other*operand if otherSide is true; else we'll return the operandthat matches cRef.



getOperator
public int getOperator()(Code)
Return the operator (as an int) for this RelationalOperator. int The operator for this RelationalOperator.



getOrderableVariantType
public int getOrderableVariantType(Optimizable optTable) throws StandardException(Code)
Return the variant type for the Qualifier's Orderable. (Is the Orderable invariant within a scan or within a query?)
Parameters:
  optTable - The Optimizable table the Qualifier will qualify int The variant type for the Qualifier's Orderable.
exception:
  StandardException - thrown on error



getStartOperator
int getStartOperator(Optimizable optTable)(Code)
Get the start operator for a scan (at the store level) for this RelationalOperator.
Parameters:
  optTable - The optimizable table we're doing the scan on.This parameter is so we can tell which side ofthe operator the table's column is on. Either ScanController.GT or ScanController.GE
See Also:   TransactionController.openScan



getStopOperator
int getStopOperator(Optimizable optTable)(Code)
Get the stop operator for a scan (at the store level) for this RelationalOperator.
Parameters:
  optTable - The optimizable table we're doing the scan on.This parameter is so we can tell which side ofthe operator the table's column is on. Either ScanController.GT or ScanController.GE
See Also:   TransactionController.openScan



getTransitiveSearchClause
public RelationalOperator getTransitiveSearchClause(ColumnReference otherCR) throws StandardException(Code)
Return a relational operator which matches the current one but with the passed in ColumnReference as the (left) operand.
Parameters:
  otherCR - The ColumnReference for the new (left) operand. A relational operator which matches the current onebut with the passed in ColumnReference as the (left) operand.
exception:
  StandardException - Thrown on error



isQualifier
boolean isQualifier(Optimizable optTable, boolean forPush) throws StandardException(Code)
Return true if this operator can be compiled into a Qualifier for the given Optimizable table. This means that there is a column from that table on one side of this relop, and an expression that does not refer to the table on the other side of the relop. Note that this method has two uses: 1) see if this operator (or more specifically, the predicate to which this operator belongs) can be used as a join predicate (esp. for a hash join), and 2) see if this operator can be pushed to the target optTable. We use the parameter "forPush" to distinguish between the two uses because in some cases (esp. situations where we have subqueries) the answer to "is this a qualifier?" can differ depending on whether or not we're pushing. In particular, for binary ops that are join predicates, if we're just trying to find an equijoin predicate then this op qualifies if it references either the target table OR any of the base tables in the table's subtree. But if we're planning to push the predicate down to the target table, this op only qualifies if it references the target table directly. This difference in behavior is required because in case 1 (searching for join predicates), the operator remains at its current level in the tree even if its operands reference nodes further down; in case 2, though, we'll end up pushing the operator down the tree to child node(s) and that requires additional logic, such as "scoping" consideration. Until that logic is in place, we don't search a subtree if the intent is to push the predicate to which this operator belongs further down that subtree. See BinaryRelationalOperatorNode for an example of where this comes into play.
Parameters:
  optTable - The Optimizable table in question.
Parameters:
  forPush - Are we asking because we're trying to push? true if this operator can be compiled into a Qualifierfor the given Optimizable table.
exception:
  StandardException - Thrown on error



orderedNulls
boolean orderedNulls()(Code)
Return true if this operator uses ordered null semantics



selfComparison
boolean selfComparison(ColumnReference cr) throws StandardException(Code)
Check whether this RelationalOperator compares the given ColumnReference to any columns in the same table as the ColumnReference.
Parameters:
  cr - The ColumnReference that is being compared to someexpression. true if the given ColumnReference is being compared to anycolumns from the same table
exception:
  StandardException - Thrown on error



usefulStartKey
boolean usefulStartKey(Optimizable optTable)(Code)
Tell whether this relop is a useful start key for the given table. It has already been determined that the relop has a column from the given table on one side or the other.
Parameters:
  optTable - The Optimizable table for which we want to knowwhether this is a useful start key. true if this is a useful start key



usefulStopKey
boolean usefulStopKey(Optimizable optTable)(Code)
Tell whether this relop is a useful stop key for the given table. It has already been determined that the relop has a column from the given table on one side or the other.
Parameters:
  optTable - The Optimizable table for which we want to knowwhether this is a useful stop key. true if this is a useful stop key



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