NoSyncObjectStore (cayenne-doc: Cayenne Documentation 5.0-M2 API)
Description: declaration: package: org.apache.cayenne.access, class: NoSyncObjectStore

# Class NoSyncObjectStore

java.lang.Object
org.apache.cayenne.access.ObjectStore
org.apache.cayenne.access.NoSyncObjectStore

All Implemented Interfaces:
  `Serializable, EventListener, SnapshotEventListener, GraphChangeHandler, GraphManager`

public class NoSyncObjectStore extends ObjectStore
An `ObjectStore` which doesn't receive notifications on parent's `DataRowStore` events.

Since:
  3.1
See Also:
  - Serialized Form

- ## Field Summary

  ### Fields inherited from class ObjectStore

  `changes, context, dataRowCache, dataRowCacheSet, objectMap, trackedFlattenedPaths`
  Modifier and Type
  Field
  Description
  `protected Map<Object, ObjectDiff>`
  `changes`
  `protected DataContext`
  `context`
  The DataContext that owns this ObjectStore.
  `protected DataRowStore`
  `dataRowCache`
  Stores a reference to the DataRowStore.
  `protected boolean`
  `dataRowCacheSet`
  `protected Map<Object, Persistent>`
  `objectMap`
  `protected Map<Object, Map<CayennePath, ObjectId>>`
  `trackedFlattenedPaths`
  Map that tracks flattened paths for given object Id that is present in db.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `NoSyncObjectStore(DataRowStore dataRowCache, Map<Object, Persistent> objectMap)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `setDataRowCache(DataRowStore dataRowCache)`
  Sets parent DataRowStore.

  ### Methods inherited from class ObjectStore

  `arcCreated, arcDeleted, getCachedSnapshot, getContext, getDataRowCache, getFlattenedId, getFlattenedIds, getFlattenedPathIdMap, getNode, getObjectIterator, getSnapshot, hasChanges, markFlattenedPath, nodeCreated, nodeIdChanged, nodePropertyChanged, nodeRemoved, objectsInState, objectsRolledBack, objectsUnregistered, postprocessAfterCommit, registeredNodes, registeredObjectsCount, registerNode, setContext, snapshotsChanged, unregisterNode`
  Modifier and Type
  Method
  Description
  `void`
  `arcCreated(Object nodeId, Object targetNodeId, ArcId arcId)`
  Notifies implementing object that a new arc was created between two nodes.
  `void`
  `arcDeleted(Object nodeId, Object targetNodeId, ArcId arcId)`
  Notifies implementing object that an arc between two nodes was deleted.
  `DataRow`
  `getCachedSnapshot(ObjectId oid)`
  Returns a snapshot for ObjectId from the underlying snapshot cache.
  `DataContext`
  `getContext()`
  `DataRowStore`
  `getDataRowCache()`
  Returns a DataRowStore associated with this ObjectStore.
  `ObjectId`
  `getFlattenedId(ObjectId objectId, CayennePath path)`
  `Collection<ObjectId>`
  `getFlattenedIds(ObjectId objectId)`
  `Map<CayennePath, ObjectId>`
  `getFlattenedPathIdMap(ObjectId objectId)`
  `Object`
  `getNode(Object nodeId)`
  Returns a registered Persistent objects or null of no object exists for the ObjectId.
  `Iterator<Persistent>`
  `getObjectIterator()`
  Returns an iterator over the registered objects.
  `DataRow`
  `getSnapshot(ObjectId oid)`
  Returns a snapshot for ObjectId from the underlying snapshot cache.
  `boolean`
  `hasChanges()`
  Returns `true` if there are any modified, deleted or new objects registered with this ObjectStore, `false` otherwise.
  `void`
  `markFlattenedPath(ObjectId objectId, CayennePath path, ObjectId id)`
  Mark that flattened path for object has data row in DB.
  `void`
  `nodeCreated(Object nodeId)`
  Notifies implementing object that a new node was created in the graph.
  `void`
  `nodeIdChanged(Object nodeId, Object newId)`
  Does nothing.
  `void`
  `nodePropertyChanged(Object nodeId, String property, Object oldValue, Object newValue)`
  Records dirty object snapshot.
  `void`
  `nodeRemoved(Object nodeId)`
  Notifies implementing object that a node was removed from the graph.
  `List<Persistent>`
  `objectsInState(int state)`
  Return a subset of registered objects that are in a certain persistence state.
  `void`
  `objectsRolledBack()`
  Reverts changes to all stored uncomitted objects.
  `void`
  `objectsUnregistered(Collection objects)`
  Evicts a collection of Persistent objects from the ObjectStore, invalidates the underlying cache snapshots.
  `void`
  `postprocessAfterCommit(GraphDiff parentChanges)`
  Internal unsynchronized method to process objects state after commit.
  `Collection<Object>`
  `registeredNodes()`
  Returns all registered Persistent objects.
  `int`
  `registeredObjectsCount()`
  Returns a number of objects currently registered with this ObjectStore.
  `void`
  `registerNode(Object nodeId, Object nodeObject)`
  "Registers" a graph node, usually storing the node in some internal map using its id as a key.
  `void`
  `setContext(DataContext context)`
  `void`
  `snapshotsChanged(SnapshotEvent event)`
  SnapshotEventListener implementation that processes snapshot change event, updating Persistent objects that have the changes.
  `Object`
  `unregisterNode(Object nodeId)`
  "Unregisters" a graph node, forgetting any information associated with nodeId.

  ### Methods inherited from class Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### NoSyncObjectStore

    public NoSyncObjectStore(DataRowStore dataRowCache, Map<Object, Persistent> objectMap)

- ## Method Details

  - ### setDataRowCache

    public void setDataRowCache(DataRowStore dataRowCache)
    Description copied from class: `ObjectStore`
    Sets parent DataRowStore. Registers to receive SnapshotEvents if the cache is configured to allow ObjectStores to receive such events.
    Overrides:
      `setDataRowCache` in class `ObjectStore`