Package org.eclipse.persistence.history
Class AsOfClause
java.lang.Object
org.eclipse.persistence.history.AsOfClause
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AsOfSCNClause
Purpose:Wraps an immutable value for a past time.
A session, query, or expression can be as of a past time.
For Oracle 9R2 Flasback corresponds to the sub clause which appears between
the table and alias name in the FROM clause:
SELECT ... FROM EMPLOYEE AS OF TIMESTAMP (value) t0, ...
For generic historical schema support, a special criteria can be added to
the where clause for each table in a select:
((t0.ROW_START <= value) AND ((t0.END IS NULL) OR (t1.END > value)))
Responsibilities:
- By default AsOfClause is a timestamp. To specify a system change number use AsOfSCNClause.
- For Oracle 9R2 Flashback prints the correct AS OF clause before the alias name in the FROM clause.
- Read-only: the wrapped value can not change.
- See Also:
- Author:
- Stephen McRitchie
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AsOfClause
(long time) AsOfClause
(Long time) protected
AsOfClause
(Number number) AsOfClause
(Timestamp timestamp) AsOfClause
(Calendar calendar) AsOfClause
(Date date) AsOfClause
(Expression expression) protected
AsOfClause
(AsOfClause wrappedValue) -
Method Summary
Modifier and TypeMethodDescriptionboolean
INTERNAL: Return if the as of is equal to the other.getValue()
PUBLIC: The past time represented by the receiver.boolean
PUBLIC: Indicates thatvalue
is a system change number or an expression evaluating to one.boolean
PUBLIC: Answers if this is a UniversalAsOfClause, one to be applied to the entire selection criteria.void
printSQL
(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer) INTERNAL: Prints the as of clause for an expression inside of the FROM clause.toString()
-
Field Details
-
NO_CLAUSE
-
-
Constructor Details
-
AsOfClause
protected AsOfClause() -
AsOfClause
-
AsOfClause
-
AsOfClause
-
AsOfClause
public AsOfClause(long time) -
AsOfClause
-
AsOfClause
-
AsOfClause
-
AsOfClause
-
-
Method Details
-
equals
INTERNAL: Return if the as of is equal to the other. Equality of asOf clauses is complex (with subclasses), so only use identity. -
printSQL
public void printSQL(org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter printer) INTERNAL: Prints the as of clause for an expression inside of the FROM clause. -
getValue
PUBLIC: The past time represented by the receiver. Either a timestamp, a system change number, or an Expression. -
isAsOfSCNClause
public boolean isAsOfSCNClause()PUBLIC: Indicates thatvalue
is a system change number or an expression evaluating to one.In Oracle the value will have to be printed using the syntax
AS OF SCN(value)
instead ofAS OF TIMESTAMP(value)
.- See Also:
-
isUniversal
public boolean isUniversal()PUBLIC: Answers if this is a UniversalAsOfClause, one to be applied to the entire selection criteria.Used when a query is made as of a past time.
-
toString
-