An expression to be pushed into a Table Function so that the Table Function can short-circuit its processing and return fewer rows. A restriction is represented as a binary tree. The non-leaf nodes are ANDs and ORs. The leaf nodes are ColumnQualifiers. A ColumnQualifier is a simple expression comparing a constant value to a column in the Table Function.
| Modifier and Type | Class and Description |
|---|---|
| public static class | Restriction.
An AND of two Restrictions |
| public static class | Restriction.
A simple comparison of a column to a constant value. |
| public static class | Restriction.
An OR of two Restrictions |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected String | Returns: the original string wrapped in parenthesesThe original string raw)Utility method to parenthesize an expression |
| public abstract String | Returns: this Restriction as a string suitable for use in a WHERE clause.Turn this Restriction into a string suitable for use in a WHERE clause. |
| Restriction | back to summary |
|---|---|
| public Restriction() | |
| parenthesize | back to summary |
|---|---|
| protected String parenthesize(String raw) Utility method to parenthesize an expression | |
| toSQL | back to summary |
|---|---|
| public abstract String toSQL() Turn this Restriction into a string suitable for use in a WHERE clause.
| |
| Modifier and Type | Field and Description |
|---|---|
| private Restriction | |
| private Restriction | |
| public static final long | serialVersionUID
Derby serializes these objects in PreparedStatements |
| Access | Constructor and Description |
|---|---|
| public | AND(Restriction
The first conjunct leftChild, Restriction The second conjunct rightChild)AND together two other Restrictions |
| Modifier and Type | Method and Description |
|---|---|
| public Restriction | |
| public Restriction | |
| public String | Returns: this Restriction as WHERE clause textImplements abstract org. Turn this Restriction into WHERE clause text. |
| _leftChild | back to summary |
|---|---|
| private Restriction _leftChild | |
| _rightChild | back to summary |
|---|---|
| private Restriction _rightChild | |
| serialVersionUID | back to summary |
|---|---|
| public static final long serialVersionUID Derby serializes these objects in PreparedStatements | |
| AND | back to summary |
|---|---|
| public AND(Restriction leftChild, Restriction rightChild) AND together two other Restrictions
| |
| getLeftChild | back to summary |
|---|---|
| public Restriction getLeftChild() Get the left Restriction
| |
| getRightChild | back to summary |
|---|---|
| public Restriction getRightChild() Get the right Restriction
| |
| toSQL | back to summary |
|---|---|
| public String toSQL() Implements abstract org. Turn this Restriction into WHERE clause text.
| |
A simple comparison of a column to a constant value. The comparison has the form:
column OP constant
where OP is one of the following:
< = <= > >= IS NULL IS NOT NULL
| Modifier and Type | Field and Description |
|---|---|
| private String | _columnName
name of column being restricted |
| private int | _comparisonOperator
comparison operator, one of the ORDER_OP constants |
| private Object | _constantOperand
value to compare the column to |
| private String[] | |
| public static final int | ORDER_OP_EQUALS
Ordering operation constant representing '=' |
| public static final int | ORDER_OP_GREATEROREQUALS
Ordering operation constant representing '>=' |
| public static final int | ORDER_OP_GREATERTHAN
Ordering operation constant representing '>' |
| public static final int | ORDER_OP_ISNOTNULL
Ordering operation constant representing 'IS NOT NULL' |
| public static final int | ORDER_OP_ISNULL
Ordering operation constant representing 'IS NULL' |
| public static final int | ORDER_OP_LESSOREQUALS
Ordering operation constant representing '<=' |
| public static final int | ORDER_OP_LESSTHAN
Ordering operation constant representing '<' |
| public static final int | ORDER_OP_NOT_EQUALS
Ordering operation constant representing '!=' |
| public static final long | serialVersionUID
Derby serializes these objects in PreparedStatements |
| Access | Constructor and Description |
|---|---|
| public | ColumnQualifier(String
Name of column as declared in the CREATE FUNCTION statement. columnName, int One of the ORDER_OP constants. comparisonOperator, Object Constant value to which the column should be compared. constantOperand)Construct from pieces. |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the name of the column being comparedThe name of the column being compared. |
| public int | Returns: an ORDER_OP representing the type of comparison to performThe type of comparison to perform. |
| public Object | Returns: the constant with which the column is being comparedGet the constant value to which the column should be compared. |
| protected String | |
| public String | Returns: this Restriction as WHERE clause textImplements abstract org. Turn this Restriction into WHERE clause text. |
| _columnName | back to summary |
|---|---|
| private String _columnName name of column being restricted | |
| _comparisonOperator | back to summary |
|---|---|
| private int _comparisonOperator comparison operator, one of the ORDER_OP constants | |
| _constantOperand | back to summary |
|---|---|
| private Object _constantOperand value to compare the column to | |
| OPERATOR_SYMBOLS | back to summary |
|---|---|
| private String[] OPERATOR_SYMBOLS | |
| ORDER_OP_EQUALS | back to summary |
|---|---|
| public static final int ORDER_OP_EQUALS Ordering operation constant representing '=' | |
| ORDER_OP_GREATEROREQUALS | back to summary |
|---|---|
| public static final int ORDER_OP_GREATEROREQUALS Ordering operation constant representing '>=' | |
| ORDER_OP_GREATERTHAN | back to summary |
|---|---|
| public static final int ORDER_OP_GREATERTHAN Ordering operation constant representing '>' | |
| ORDER_OP_ISNOTNULL | back to summary |
|---|---|
| public static final int ORDER_OP_ISNOTNULL Ordering operation constant representing 'IS NOT NULL' | |
| ORDER_OP_ISNULL | back to summary |
|---|---|
| public static final int ORDER_OP_ISNULL Ordering operation constant representing 'IS NULL' | |
| ORDER_OP_LESSOREQUALS | back to summary |
|---|---|
| public static final int ORDER_OP_LESSOREQUALS Ordering operation constant representing '<=' | |
| ORDER_OP_LESSTHAN | back to summary |
|---|---|
| public static final int ORDER_OP_LESSTHAN Ordering operation constant representing '<' | |
| ORDER_OP_NOT_EQUALS | back to summary |
|---|---|
| public static final int ORDER_OP_NOT_EQUALS Ordering operation constant representing '!=' | |
| serialVersionUID | back to summary |
|---|---|
| public static final long serialVersionUID Derby serializes these objects in PreparedStatements | |
| ColumnQualifier | back to summary |
|---|---|
| public ColumnQualifier(String columnName, int comparisonOperator, Object constantOperand) Construct from pieces. | |
| getColumnName | back to summary |
|---|---|
| public String getColumnName() The name of the column being compared.
| |
| getComparisonOperator | back to summary |
|---|---|
| public int getComparisonOperator() The type of comparison to perform. This is one of the ORDER_OP constants defined above.
| |
| getConstantOperand | back to summary |
|---|---|
| public Object getConstantOperand() Get the constant value to which the column should be compared. The constant value must be an Object of the Java type which corresponds to the SQL type of the column. The column's SQL type was declared in the CREATE FUNCTION statement. The mapping of SQL types to Java types is defined in table 4 of chapter 14 of the original JDBC 1 specification (dated 1996). Bascially, these are the Java wrapper values you would expect. For instance, SQL INT maps to java.lang.Integer, SQL CHAR maps to java.lang.String, etc.. This object will be null if the comparison operator is ORDER_OP_ISNULL or ORDER_OP_ISNOTNULL.
| |
| toEscapedString | back to summary |
|---|---|
| protected String toEscapedString(Object o) | |
| toSQL | back to summary |
|---|---|
| public String toSQL() Implements abstract org. Turn this Restriction into WHERE clause text.
| |
| Modifier and Type | Field and Description |
|---|---|
| private Restriction | |
| private Restriction | |
| public static final long | serialVersionUID
Derby serializes these objects in PreparedStatements |
| Access | Constructor and Description |
|---|---|
| public | OR(Restriction
The first disjunct leftChild, Restriction The second disjunct rightChild)OR together two other Restrictions |
| Modifier and Type | Method and Description |
|---|---|
| public Restriction | |
| public Restriction | |
| public String | Returns: this Restriction as WHERE clause textImplements abstract org. Turn this Restriction into WHERE clause text. |
| _leftChild | back to summary |
|---|---|
| private Restriction _leftChild | |
| _rightChild | back to summary |
|---|---|
| private Restriction _rightChild | |
| serialVersionUID | back to summary |
|---|---|
| public static final long serialVersionUID Derby serializes these objects in PreparedStatements | |
| OR | back to summary |
|---|---|
| public OR(Restriction leftChild, Restriction rightChild) OR together two other Restrictions
| |
| getLeftChild | back to summary |
|---|---|
| public Restriction getLeftChild() Get the left Restriction
| |
| getRightChild | back to summary |
|---|---|
| public Restriction getRightChild() Get the right Restriction
| |
| toSQL | back to summary |
|---|---|
| public String toSQL() Implements abstract org. Turn this Restriction into WHERE clause text.
| |