| Modifier and Type | Field and Description |
|---|---|
| protected ExpressionBuilder | |
| protected Expression | |
| protected ExpressionOperator | |
| protected transient ExpressionOperator | |
| protected Expression |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public DatabaseTable | aliasForTable(DatabaseTable table)
Overrides org. |
| public Expression | asOf(AsOfClause
A read only data object used to represent a past time. clause)Overrides org. |
| public int | computeHashCode()
Overrides org. |
| public Expression | create(Expression base, Object singleArgument, ExpressionOperator operator)
Overrides org. |
| public Expression | create(Expression base, List<E> arguments, ExpressionOperator operator)
Overrides org. |
| public String | descriptionOfNodeType()
Overrides org. |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides org. |
| public ExpressionBuilder | getBuilder()
Implements abstract org. |
| public Expression | |
| public ExpressionOperator | getOperator()
Overrides org. |
| public ExpressionOperator | |
| public Expression | |
| public void | |
| public boolean | isCompoundExpression()
Overrides org. |
| public void | iterateOn(ExpressionIterator iterator)
Overrides org. |
| public Expression | normalize(ExpressionNormalizer normalizer)
Overrides org. |
| protected void | postCopyIn(Map<K, V> alreadyDone)
Overrides org. |
| public void | printJava(ExpressionJavaPrinter printer)
Overrides org. |
| public void | printSQL(ExpressionSQLPrinter printer)
Implements abstract org. |
| public Expression | rebuildOn(Expression newBase)
Implements abstract org. |
| public void | resetPlaceHolderBuilder(ExpressionBuilder queryBuilder)
Implements abstract org. |
| protected void | |
| public void | |
| protected void | |
| public Expression | shallowClone()
Overrides org. |
| public Expression | twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
Overrides org. |
| public void | validateNode()
Overrides org. |
| public void | writeDescriptionOn(BufferedWriter writer)
Overrides org. |
| public void | writeSubexpressionsTo(BufferedWriter writer, int indent)
Overrides org. |
| builder | back to summary |
|---|---|
| protected ExpressionBuilder builder | |
| firstChild | back to summary |
|---|---|
| protected Expression firstChild | |
| operator | back to summary |
|---|---|
| protected ExpressionOperator operator | |
| platformOperator | back to summary |
|---|---|
| protected transient ExpressionOperator platformOperator | |
| secondChild | back to summary |
|---|---|
| protected Expression secondChild | |
| CompoundExpression | back to summary |
|---|---|
| protected CompoundExpression() | |
| aliasForTable | back to summary |
|---|---|
| public DatabaseTable aliasForTable(DatabaseTable table) Overrides org. INTERNAL: Find the alias for a given table from the first or second child in the additionalOuterJoinCriteria
| |
| asOf | back to summary |
|---|---|
| public Expression asOf(AsOfClause clause) Overrides org. Doc from org. Sets all tables represented by this expression to be queried as of a past time. Example: EclipseLink: employee.asOf(new AsOfClause(pastTime)) Java: None SQL (Flashback): SELECT ... FROM EMPLOYEE AS OF TIMESTAMP (pastTime) t0 ... SQL (Generic): .. WHERE (t1.START <= pastTime) AND ((t1.END IS NULL) OR t1.END > pastTime) Set an as of clause at the expression level to still query for current objects while expressing selection criteria like:
Simultaneously querying on two versions of the same object (one past one present) lets you express these advanced selection criteria. Example: Querying on past attributes using parallel expressions.
The advantage of the parallel expression is that you can still read current objects, the as of clause will affect only the where clause / selection criteria. You may be tempted to rewrite the above as employee.get("address").asOf(pastTime). That is allowed but see below for the finer points involved in this. Example: Querying on object changes using parallel expressions.
Example: Querying on object changes using custom query keys
Note in general that any parallel expression can be rewritten using a custom query key. EclipseLink will even automatically interpret x.get("this") for you so you do not need to define the above query key first. Full Reference: If an object is mapped to multiple tables, then each table will be as of the same time. Two objects mapped to the same table can not have different as of times. Conversely only expressions which have associated tables can have an as of clause. If an as of clause is not explicitly set an expression will use the clause of its base expression, and so on recursively until one is found or an ExpressionBuilder is reached. Some usage scenarios follow:
Watch out for x.asOf(oneTime).get("y").asOf(anotherTime).
| |
| computeHashCode | back to summary |
|---|---|
| public int computeHashCode() Overrides org. INTERNAL: Compute a consistent hash-code for the expression. This is used to allow dynamic expression's SQL to be cached.
| |
| create | back to summary |
|---|---|
| public Expression create(Expression base, Object singleArgument, ExpressionOperator operator) Overrides org. INTERNAL:
| |
| create | back to summary |
|---|---|
| public Expression create(Expression base, List<E> arguments, ExpressionOperator operator) Overrides org. INTERNAL:
| |
| descriptionOfNodeType | back to summary |
|---|---|
| public String descriptionOfNodeType() Overrides org. INTERNAL: Used for debug printing.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object object) Overrides org. INTERNAL: Return if the expression is equal to the other. This is used to allow dynamic expression's SQL to be cached.
| |
| getBuilder | back to summary |
|---|---|
| public ExpressionBuilder getBuilder() Implements abstract org. Return the expression builder which is the ultimate base of this expression, or null if there isn't one (shouldn't happen if we start from a root)
| |
| getFirstChild | back to summary |
|---|---|
| public Expression getFirstChild() | |
| getOperator | back to summary |
|---|---|
| public ExpressionOperator getOperator() Overrides org. Doc from org. INTERNAL: Most expression have operators, so this is just a convenience method.
| |
| getPlatformOperator | back to summary |
|---|---|
| public ExpressionOperator getPlatformOperator(DatabasePlatform platform) | |
| getSecondChild | back to summary |
|---|---|
| public Expression getSecondChild() | |
| initializePlatformOperator | back to summary |
|---|---|
| public void initializePlatformOperator(DatabasePlatform platform) INTERNAL: | |
| isCompoundExpression | back to summary |
|---|---|
| public boolean isCompoundExpression() Overrides org. Doc from org. INTERNAL:
| |
| iterateOn | back to summary |
|---|---|
| public void iterateOn(ExpressionIterator iterator) Overrides org. INTERNAL: For iterating using an inner class
| |
| normalize | back to summary |
|---|---|
| public Expression normalize(ExpressionNormalizer normalizer) Overrides org. INTERNAL: Normalize into a structure that is printable. Also compute printing information such as outer joins.
| |
| postCopyIn | back to summary |
|---|---|
| protected void postCopyIn(Map<K, V> alreadyDone) Overrides org. INTERNAL: Used for cloning.
| |
| printJava | back to summary |
|---|---|
| public void printJava(ExpressionJavaPrinter printer) Overrides org. INTERNAL: Print java for project class generation
| |
| printSQL | back to summary |
|---|---|
| public void printSQL(ExpressionSQLPrinter printer) Implements abstract org. INTERNAL: Print SQL
| |
| rebuildOn | back to summary |
|---|---|
| public Expression rebuildOn(Expression newBase) Implements abstract org. INTERNAL: This expression is built on a different base than the one we want. Rebuild it and return the root of the new tree
| |
| resetPlaceHolderBuilder | back to summary |
|---|---|
| public void resetPlaceHolderBuilder(ExpressionBuilder queryBuilder) Implements abstract org. INTERNAL: Search the tree for any expressions (like SubSelectExpressions) that have been built using a builder that is not attached to the query. This happens in case of an Exists call using a new ExpressionBuilder(). This builder needs to be replaced with one from the query.
| |
| setFirstChild | back to summary |
|---|---|
| protected void setFirstChild(Expression firstChild) | |
| setOperator | back to summary |
|---|---|
| public void setOperator(ExpressionOperator newOperator) | |
| setSecondChild | back to summary |
|---|---|
| protected void setSecondChild(Expression secondChild) | |
| shallowClone | back to summary |
|---|---|
| public Expression shallowClone() Overrides org. INTERNAL: Clear the builder when cloning.
| |
| twistedForBaseAndContext | back to summary |
|---|---|
| public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase) Overrides org. INTRENAL: Used to change an expression off of one base to an expression off of a different base. i.e. expression on address to an expression on an employee's address.
| |
| validateNode | back to summary |
|---|---|
| public void validateNode() Overrides org. Do any required validation for this node. Throw an exception if it's incorrect. Ensure that both sides are not data expressions.
| |
| writeDescriptionOn | back to summary |
|---|---|
| public void writeDescriptionOn(BufferedWriter writer) throws IOException Overrides org. INTERNAL: Used to print a debug form of the expression tree.
| |
| writeSubexpressionsTo | back to summary |
|---|---|
| public void writeSubexpressionsTo(BufferedWriter writer, int indent) throws IOException Overrides org. INTERNAL: Used for toString for debugging only.
| |