Top Description Fields Constructors Methods
org.eclipse.persistence.history

public Class AsOfClause

extends Object
implements Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable
Known Direct Subclasses
org.eclipse.persistence.history.AsOfSCNClause, org.eclipse.persistence.internal.history.UniversalAsOfClause
Imports
java.io.*, org.eclipse.persistence.expressions.*, org.eclipse.persistence.internal.expressions.*, org.eclipse.persistence.internal.helper.*

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:

Author
Stephen McRitchie
Since
OracleAS TopLink 10g (10.0.3)
See Also
org.eclipse.persistence.expressions.Expression#asOf(AsOfClause), org.eclipse.persistence.queries.ObjectLevelReadQuery#setAsOfClause(AsOfClause), org.eclipse.persistence.sessions.Session#acquireHistoricalSession(AsOfClause), HistoryPolicy

Field Summary

Modifier and TypeField and Description
public static final AsOfClause
private Object

Constructor Summary

AccessConstructor and Description
protected
public
public
AsOfClause(Timestamp timestamp)

public
AsOfClause(Calendar calendar)

public
AsOfClause(long time)

public
protected
public
AsOfClause(Expression expression)

protected
AsOfClause(AsOfClause wrappedValue)

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

INTERNAL: Return if the as of is equal to the other.
public Object
getValue()

PUBLIC: The past time represented by the receiver.

public boolean
isAsOfSCNClause()

PUBLIC: Indicates that value is a system change number or an expression evaluating to one.

public boolean
isUniversal()

PUBLIC: Answers if this is a UniversalAsOfClause, one to be applied to the entire selection criteria.

public void
printSQL(ExpressionSQLPrinter printer)

INTERNAL: Prints the as of clause for an expression inside of the FROM clause.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

NO_CLAUSEback to summary
public static final AsOfClause NO_CLAUSE
valueback to summary
private Object value

Constructor Detail

AsOfClauseback to summary
protected AsOfClause()
AsOfClauseback to summary
public AsOfClause(Date date)
AsOfClauseback to summary
public AsOfClause(Timestamp timestamp)
AsOfClauseback to summary
public AsOfClause(Calendar calendar)
AsOfClauseback to summary
public AsOfClause(long time)
AsOfClauseback to summary
public AsOfClause(Long time)
AsOfClauseback to summary
protected AsOfClause(Number number)
AsOfClauseback to summary
public AsOfClause(Expression expression)
AsOfClauseback to summary
protected AsOfClause(AsOfClause wrappedValue)

Method Detail

equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

INTERNAL: Return if the as of is equal to the other. Equality of asOf clauses is complex (with subclasses), so only use identity.

Parameters
object:Object

Doc from java.lang.Object.equals.

the reference object with which to compare.

Returns:boolean

Doc from java.lang.Object.equals.

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getValueback to summary
public Object getValue()

PUBLIC: The past time represented by the receiver. Either a timestamp, a system change number, or an Expression.

isAsOfSCNClauseback to summary
public boolean isAsOfSCNClause()

PUBLIC: Indicates that value 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 of AS OF TIMESTAMP(value).

See Also
AsOfSCNClause
isUniversalback to summary
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.

printSQLback to summary
public void printSQL(ExpressionSQLPrinter printer)

INTERNAL: Prints the as of clause for an expression inside of the FROM clause.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override