Skip Headers

# Using an ObjectLevelReadQuery With Expression Operator asOf

Previous

Next

You can query historical versions of objects using an `ObjectLevelReadQuery` (such as `ReadObjectQuery` or `ReadAllQuery`) containing one or more expressions that use `Expression` operator `asOf` to specify a point in time on an `Expression`-by-`Expression` basis.

This type of historical query lets you combine both current and historical versions of objects in the same query.

If you configure the `ObjectLevelReadQuery` with an `AsOfClause`, that point in time overrides the point in time specified in any `Expression` in the query (see "Using an ObjectLevelReadQuery With an AsOfClause").

Note: To prevent corrupting the global shared cache with old versions of objects, you must set `ObjectLevelReadQuery` method `maintainCache` to `false` in this historical query. If you do not, TopLink will throw an exception when you execute the query.

For more information and examples of using an `ObjectLevelReadQuery` with `Expression` operator `asOf`, see "Using Historical Queries".