| Modifier and Type | Field and Description |
|---|---|
| protected Vector | |
| protected ExpressionOperator | |
| protected transient ExpressionOperator | |
| protected Class |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| 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. |
| public int | computeHashCode()
Overrides org. |
| public Expression | create(Expression base, Object singleArgument, ExpressionOperator anOperator)
Overrides org. |
| public Expression | create(Expression base, List<E> arguments, ExpressionOperator anOperator)
Overrides org. |
| public Expression | createWithBaseLast(Expression base, Object singleArgument, ExpressionOperator anOperator)
Overrides org. |
| public String | descriptionOfNodeType()
Overrides org. |
| public boolean | doesConform(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean
true if object possibly not a clone, but is being
conformed against the unit of work cache; if object is not in the UOW cache
but some of its attributes are, use the registered versions of
object's attributes for the purposes of this method. isObjectUnregistered)Overrides org. |
| public boolean | equals(Object
the reference object with which to compare. object)Overrides org. |
| public Vector | |
| public List | getFields()
Overrides org. |
| public DatabaseMapping | getLeafMapping(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session)
Overrides org. |
| protected QueryKey | getLeafQueryKeyFor(DatabaseQuery query, Expression expression, ClassDescriptor rootDescriptor, AbstractSession session)
INTERNAL: Lookup the query key for this item. |
| protected DatabaseMapping | |
| public ExpressionOperator | getOperator()
Overrides org. |
| public ExpressionOperator | |
| public Class | |
| public List | getSelectionFields(ReadQuery query)
Overrides org. |
| public boolean | |
| public void | |
| public boolean | isFunctionExpression()
Overrides org. |
| protected boolean | |
| 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 | prepareObjectAttributeCount(ExpressionNormalizer normalizer, ReportItem item, ReportQuery query, Map<K, V> clonedExpressions)
INTERNAL: JPQL allows count([distinct] e), where e can be an object, not just a single field, however the database only allows a single field, so object needs to be translated to a single field. |
| 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)
Overrides org. |
| public void | setLocalBase(Expression exp)
Overrides org. |
| public void | |
| public void | |
| public Expression | twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase)
Overrides org. |
| public Object | valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean
true if object possibly not a clone, but is being
conformed against the unit of work cache. isObjectUnregistered)Overrides org. |
| public void | writeDescriptionOn(BufferedWriter writer)
Overrides org. |
| public void | writeFields(ExpressionSQLPrinter printer, List<DatabaseField> newFields, SQLSelectStatement statement)
Overrides org. |
| public void | writeSubexpressionsTo(BufferedWriter writer, int indent)
Overrides org. |
| children | back to summary |
|---|---|
| protected Vector<Expression> children | |
| operator | back to summary |
|---|---|
| protected ExpressionOperator operator | |
| platformOperator | back to summary |
|---|---|
| protected transient ExpressionOperator platformOperator | |
| resultType | back to summary |
|---|---|
| protected Class<?> resultType | |
| FunctionExpression | back to summary |
|---|---|
| public FunctionExpression() | |
| addChild | back to summary |
|---|---|
| public void addChild(Expression child) | |
| 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).
| |
| 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 anOperator) Overrides org. INTERNAL:
| |
| create | back to summary |
|---|---|
| public Expression create(Expression base, List<E> arguments, ExpressionOperator anOperator) Overrides org. INTERNAL:
| |
| createWithBaseLast | back to summary |
|---|---|
| public Expression createWithBaseLast(Expression base, Object singleArgument, ExpressionOperator anOperator) Overrides org. INTERNAL: added for Trim support. TRIM([trim_character FROM] string_primary)
| |
| descriptionOfNodeType | back to summary |
|---|---|
| public String descriptionOfNodeType() Overrides org. INTERNAL: Used for debug printing.
| |
| doesConform | back to summary |
|---|---|
| public boolean doesConform(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered) Overrides org. INTERNAL: Check if the object conforms to the expression in memory. This is used for in-memory querying. If the expression in not able to determine if the object conform throw a not supported exception.
| |
| 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. This must be over written by each subclass.
| |
| getChildren | back to summary |
|---|---|
| public Vector | |
| getFields | back to summary |
|---|---|
| public List Overrides org. INTERNAL: Not to be confused with the public getField(String) This returns a collection of all fields associated with this object. Really only applies to query keys representing an object or to expression builders.
| |
| getLeafMapping | back to summary |
|---|---|
| public DatabaseMapping getLeafMapping(DatabaseQuery query, ClassDescriptor rootDescriptor, AbstractSession session) Overrides org. INTERNAL: Lookup the mapping for this item by traversing its expression recursively.
| |
| getLeafQueryKeyFor | back to summary |
|---|---|
| protected QueryKey getLeafQueryKeyFor(DatabaseQuery query, Expression expression, ClassDescriptor rootDescriptor, AbstractSession session) throws QueryException INTERNAL: Lookup the query key for this item. If an aggregate of foreign mapping is found it is traversed. | |
| getMappingOfFirstPrimaryKey | back to summary |
|---|---|
| protected DatabaseMapping getMappingOfFirstPrimaryKey(ClassDescriptor descriptor) | |
| 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) | |
| getResultType | back to summary |
|---|---|
| public Class | |
| getSelectionFields | back to summary |
|---|---|
| public List Overrides org. INTERNAL:
| |
| hasResultType | back to summary |
|---|---|
| public boolean hasResultType() | |
| initializePlatformOperator | back to summary |
|---|---|
| public void initializePlatformOperator(DatabasePlatform platform) INTERNAL: | |
| isFunctionExpression | back to summary |
|---|---|
| public boolean isFunctionExpression() Overrides org. Doc from org. INTERNAL:
| |
| isObjectComparison | back to summary |
|---|---|
| protected boolean isObjectComparison() INTERNAL: Return if the represents an object comparison. | |
| 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. This checks for object isNull, notNull, in and notIn comparisons.
| |
| postCopyIn | back to summary |
|---|---|
| protected void postCopyIn(Map<K, V> alreadyDone) Overrides org. INTERNAL: Used for cloning.
| |
| prepareObjectAttributeCount | back to summary |
|---|---|
| public void prepareObjectAttributeCount(ExpressionNormalizer normalizer, ReportItem item, ReportQuery query, Map<K, V> clonedExpressions) INTERNAL: JPQL allows count([distinct] e), where e can be an object, not just a single field, however the database only allows a single field, so object needs to be translated to a single field. If the descriptor has a single pk, it is used, otherwise any pk is used if distinct, otherwise a subselect is used. If the object was obtained through an outer join, then the subselect also will not work, so an error is thrown. | |
| 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 using the operator.
| |
| 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) Overrides 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.
| |
| setLocalBase | back to summary |
|---|---|
| public void setLocalBase(Expression exp) Overrides org. Doc from org. INTERNAL: Set the local base expression, ie the one on the other side of the operator Most types will ignore this, since they don't need it.
| |
| setOperator | back to summary |
|---|---|
| public void setOperator(ExpressionOperator theOperator) | |
| setResultType | back to summary |
|---|---|
| public void setResultType(Class<?> resultType) | |
| twistedForBaseAndContext | back to summary |
|---|---|
| public Expression twistedForBaseAndContext(Expression newBase, Expression context, Expression oldBase) Overrides org. INTERNAL: Rebuild myself against the base, with the values of parameters supplied by the context expression. This is used for transforming a standalone expression (e.g. the join criteria of a mapping) into part of some larger expression. You normally would not call this directly, instead calling twist See the comment there for more details"
| |
| valueFromObject | back to summary |
|---|---|
| public Object valueFromObject(Object object, AbstractSession session, AbstractRecord translationRow, int valueHolderPolicy, boolean isObjectUnregistered) Overrides org. INTERNAL: Return the value for in memory comparison. This is only valid for valueable 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.
| |
| writeFields | back to summary |
|---|---|
| public void writeFields(ExpressionSQLPrinter printer, List<DatabaseField> newFields, SQLSelectStatement statement) Overrides org. INTERNAL: called from SQLSelectStatement.writeFieldsFromExpression(...)
| |
| writeSubexpressionsTo | back to summary |
|---|---|
| public void writeSubexpressionsTo(BufferedWriter writer, int indent) throws IOException Overrides org. INTERNAL: Used in SQL printing.
| |