Class ObjectSnapshots

java.lang.Object
org.apache.cayenne.access.ObjectSnapshots

public final class ObjectSnapshots extends Object
Builds DataRow snapshots of persistent objects from their current, possibly uncommitted, in-memory state.
Since:
5.0
  • Method Details

    • snapshot

      public static DataRow snapshot(DataContext context, Persistent object, long version)
      Returns a DataRow reflecting the current, possibly uncommitted, state of an object registered in the given context, with the given snapshot version.

      Warning: the snapshot is partial if the object, or a related object that propagates its key to it, has a temporary id. Do not use it where a DataRow has to represent the complete object state.

      Parameters:
      context - the context the object is registered in
      object - the object to snapshot
      version - the snapshot version of the returned row