Interface ObjectStore

All Known Implementing Classes:
DataContextObjectStore

public interface ObjectStore
A registry of persistent objects managed by an ObjectContext, keyed by ObjectId. Also tracks the committed state of those objects as DataRow snapshots. Users rarely need to access the store directly, as ObjectContext serves as a facade for most of its operations.
Since:
5.0
  • Method Details

    • getObject

      Persistent getObject(ObjectId id)
      Returns a registered object for the id, or null if no such object is registered.
    • registerObject

      void registerObject(ObjectId id, Persistent nodeObject)
      Registers an object under the id.
    • unregisterObject

      Persistent unregisterObject(ObjectId id)
      Unregisters an object with the id, forgetting any information associated with it. Returns the unregistered object, or null if none was registered.
    • registeredObjects

      Collection<Persistent> registeredObjects()
      Returns a copy of the collection of all registered objects.
    • objectsInState

      List<Persistent> objectsInState(int state)
      Returns registered objects in a given PersistenceState.
    • hasChanges

      boolean hasChanges()
      Returns true if any registered objects have uncommitted changes.
    • getCachedSnapshot

      DataRow getCachedSnapshot(ObjectId oid)
      Returns a committed snapshot of an object with the id from the cache, or null if it is not cached. Unlike getSnapshot(ObjectId), never fetches from the database.
    • getSnapshot

      DataRow getSnapshot(ObjectId oid)
      Returns a committed snapshot of an object with the id, fetching it from the database if needed. Returns null if no such row exists.