| Modifier and Type | Field and Description |
|---|---|
| protected AsOfClause | |
| protected List | |
| protected List | |
| protected boolean | |
| protected TableAliasLookup |
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| 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. |
| protected void | assignAlias(String name, DatabaseTable table)
Overrides org. |
| protected void | assignAlias(DatabaseTable alias, DatabaseTable table)
INTERNAL: Alias a particular table within this node |
| public void | |
| public List | |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides org. |
| public Expression | |
| public Expression | |
| public Expression | getAlias(Expression subSelect)
Overrides org. |
| public DatabaseField | |
| public AsOfClause | getAsOfClause()
Overrides org. |
| public ClassDescriptor | |
| public ClassDescriptor | |
| public DatabaseField | |
| public Expression | getField(String fieldName)
Overrides org. |
| public Expression | getField(DatabaseField field)
Overrides org. |
| public DatabaseMapping | |
| public QueryKey | |
| public Expression | getTable(String tableName)
Overrides org. |
| public Expression | getTable(DatabaseTable table)
Overrides org. |
| public TableAliasLookup | getTableAliases()
Overrides org. |
| public boolean | hasAsOfClause()
Overrides org. this is to be queried as of a past time.
|
| public boolean | hasBeenAliased()
Overrides org. |
| public boolean | hasBeenNormalized()
INTERNAL: Did the normalizer already add additional joins to the where clause due to this query key representing a foreign reference mapping? |
| protected boolean | |
| protected boolean | |
| public boolean | |
| public boolean | isDataExpression()
Overrides org. |
| public void | iterateOn(ExpressionIterator iterator)
Overrides org. |
| public Expression | |
| public Expression | |
| public Expression | normalize(ExpressionNormalizer normalizer)
Overrides org. |
| protected void | postCopyIn(Map<K, V> alreadyDone)
Overrides org. |
| public void | printSQL(ExpressionSQLPrinter printer)
Implements abstract org. |
| public void | |
| public void | setTableAliases(TableAliasLookup tableAliases)
INTERNAL: For CR#2456, Table identity involves having two tables sharing the same aliasing table. |
| public String | |
| public void | writeSubexpressionsTo(BufferedWriter writer, int indent)
Overrides org. |
| asOfClause | back to summary |
|---|---|
| protected AsOfClause asOfClause | |
| derivedFields | back to summary |
|---|---|
| protected List<Expression> derivedFields | |
| derivedTables | back to summary |
|---|---|
| protected List<Expression> derivedTables | |
| hasBeenNormalized | back to summary |
|---|---|
| protected boolean hasBeenNormalized | |
| tableAliases | back to summary |
|---|---|
| protected TableAliasLookup tableAliases | |
| DataExpression | back to summary |
|---|---|
| protected DataExpression() DataExpression constructor comment. | |
| addDerivedField | back to summary |
|---|---|
| public void addDerivedField(Expression addThis) | |
| addDerivedTable | back to summary |
|---|---|
| public void addDerivedTable(Expression addThis) | |
| aliasForTable | back to summary |
|---|---|
| public DatabaseTable aliasForTable(DatabaseTable table) Overrides org. INTERNAL: Find the alias for a given table
| |
| 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).
| |
| assignAlias | back to summary |
|---|---|
| protected void assignAlias(String name, DatabaseTable table) Overrides org. INTERNAL: Alias a particular table within this node
| |
| assignAlias | back to summary |
|---|---|
| protected void assignAlias(DatabaseTable alias, DatabaseTable table) INTERNAL: Alias a particular table within this node | |
| clearAliases | back to summary |
|---|---|
| public void clearAliases() INTERNAL: | |
| copyCollection | back to summary |
|---|---|
| public List | |
| 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.
| |
| existingDerivedField | back to summary |
|---|---|
| public Expression existingDerivedField(DatabaseField field) INTERNAL: | |
| existingDerivedTable | back to summary |
|---|---|
| public Expression existingDerivedTable(DatabaseTable table) INTERNAL: | |
| getAlias | back to summary |
|---|---|
| public Expression getAlias(Expression subSelect) Overrides org. ADVANCED: Return an expression representing a sub-select in the from clause. Example:
builder.getAlias(builder.subQuery(reportQuery)).get("type").equal("S");
| |
| getAliasedField | back to summary |
|---|---|
| public DatabaseField getAliasedField() INTERNAL: Return the field appropriately aliased | |
| getAsOfClause | back to summary |
|---|---|
| public AsOfClause getAsOfClause() Overrides org. Doc from org. Answers the past time the expression is explicitly as of.
| |
| getContainingDescriptor | back to summary |
|---|---|
| public ClassDescriptor getContainingDescriptor() INTERNAL: Return the descriptor which contains this query key. | |
| getDescriptor | back to summary |
|---|---|
| public ClassDescriptor getDescriptor() | |
| getField | back to summary |
|---|---|
| public DatabaseField getField() INTERNAL: | |
| getField | back to summary |
|---|---|
| public Expression getField(String fieldName) Overrides org. Doc from org. ADVANCED: Return an expression representing a field in a data-level query. This is used internally in EclipseLink, or to construct queries involving fields and/or tables that are not mapped. Example:
| |
| getField | back to summary |
|---|---|
| public Expression getField(DatabaseField field) Overrides org. Doc from org. ADVANCED: Return an expression representing a field in a data-level query. This is used internally in EclipseLink, or to construct queries involving fields and/or tables that are not mapped. Example: builder.getField(aField).greaterThan(100);
| |
| getMapping | back to summary |
|---|---|
| public DatabaseMapping getMapping() | |
| getQueryKeyOrNull | back to summary |
|---|---|
| public QueryKey getQueryKeyOrNull() | |
| getTable | back to summary |
|---|---|
| public Expression getTable(String tableName) Overrides org. Doc from org. ADVANCED: Return an expression representing a table in a data-level query. This is used internally in EclipseLink, or to construct queries involving fields and/or tables that are not mapped. Example:
| |
| getTable | back to summary |
|---|---|
| public Expression getTable(DatabaseTable table) Overrides org. Doc from org. ADVANCED: Return an expression representing a table in a data-level query. This is used internally in EclipseLink, or to construct queries involving fields and/or tables that are not mapped. Example:
| |
| getTableAliases | back to summary |
|---|---|
| public TableAliasLookup getTableAliases() Overrides org. INTERNAL: Return the aliases used. For CR#2456 must never lazily initialize as also used for Expression identity.
| |
| hasAsOfClause | back to summary |
|---|---|
| public boolean hasAsOfClause() Overrides org. Doc from org. ADVANCED:
Answers true if
| |
| hasBeenAliased | back to summary |
|---|---|
| public boolean hasBeenAliased() Overrides org. Doc from org. INTERNAL: Answers if the database tables associated with this expression have been aliased. This insures the same tables are not aliased twice.
| |
| hasBeenNormalized | back to summary |
|---|---|
| public boolean hasBeenNormalized() INTERNAL: Did the normalizer already add additional joins to the where clause due to this query key representing a foreign reference mapping? This insures that join criteria (for any query key expression) is not added twice. New meaning: DataExpressions are often iterated on multiple times during normalize, but Function/Relation expressions only once. Adding a has been normalized flag improves performance and is required in some applications, such as have temporal query criteria been added. | |
| hasDerivedFields | back to summary |
|---|---|
| protected boolean hasDerivedFields() | |
| hasDerivedTables | back to summary |
|---|---|
| protected boolean hasDerivedTables() | |
| isAttribute | back to summary |
|---|---|
| public boolean isAttribute() INTERNAL: | |
| isDataExpression | back to summary |
|---|---|
| public boolean isDataExpression() Overrides org. Doc from org. INTERNAL:
| |
| iterateOn | back to summary |
|---|---|
| public void iterateOn(ExpressionIterator iterator) Overrides org. INTERNAL: For iterating using an inner class
| |
| newDerivedField | back to summary |
|---|---|
| public Expression newDerivedField(DatabaseField field) INTERNAL: | |
| newDerivedTable | back to summary |
|---|---|
| public Expression newDerivedTable(DatabaseTable table) INTERNAL: | |
| normalize | back to summary |
|---|---|
| public Expression normalize(ExpressionNormalizer normalizer) Overrides org. INTERNAL: Normalize the expression into a printable structure. Any joins must be added to form a new root.
| |
| postCopyIn | back to summary |
|---|---|
| protected void postCopyIn(Map<K, V> alreadyDone) Overrides org. INTERNAL: Used for cloning.
| |
| printSQL | back to summary |
|---|---|
| public void printSQL(ExpressionSQLPrinter printer) Implements abstract org. INTERNAL: Print SQL onto the stream, using the ExpressionPrinter for context
| |
| setHasBeenNormalized | back to summary |
|---|---|
| public void setHasBeenNormalized(boolean value) | |
| setTableAliases | back to summary |
|---|---|
| public void setTableAliases(TableAliasLookup tableAliases) INTERNAL: For CR#2456, Table identity involves having two tables sharing the same aliasing table. | |
| tableAliasesDescription | back to summary |
|---|---|
| public String tableAliasesDescription() | |
| writeSubexpressionsTo | back to summary |
|---|---|
| public void writeSubexpressionsTo(BufferedWriter writer, int indent) throws IOException Overrides org. Print the base for debuggin purposes.
| |