Class DataContext.Builder
java.lang.Object
org.apache.cayenne.access.DataContext.Builder
- Enclosing class:
DataContext
A builder of
DataContext instances. Created via DataContext.builder(DataChannel).- Since:
- 5.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()objectMap(Map<ObjectId, Persistent> objectMap) Sets a map to store registered objects in.queryCache(QueryCache queryCache) Sets a cache for query results.snapshotCache(DataRowStore snapshotCache) Sets a snapshot cache for the context's ObjectStore.syncWithSnapshotCache(boolean sync) Sets whether the context's ObjectStore should listen to snapshot cache events, updating its objects with changes made in other contexts.usingSharedSnapshotCache(boolean usingSharedSnapshotCache) Sets whether the snapshot cache is the shared cache of the parent DataDomain.validatingObjectsOnCommit(boolean validating) Sets whether the context validates objects before commit.
-
Constructor Details
-
Builder
-
-
Method Details
-
snapshotCache
Sets a snapshot cache for the context's ObjectStore. Nested contexts have no cache of their own and take snapshots from the parent context instead. Default is no cache. -
objectMap
Sets a map to store registered objects in. The map determines how strongly the context retains objects. Default is a map with weak references to the values. -
syncWithSnapshotCache
Sets whether the context's ObjectStore should listen to snapshot cache events, updating its objects with changes made in other contexts. Default is false. -
validatingObjectsOnCommit
Sets whether the context validates objects before commit. Default is true. -
queryCache
Sets a cache for query results. Default is no cache. -
build
-