Class SnapshotVersion

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

public final class SnapshotVersion extends Object
Incrementing global snapshot version generator. A version is taken once per operation that produces snapshots, i.e. once per SQL statement result, per commit and per snapshot event, and every DataRow the operation produces carries it, as does every object created from or committed as such a row.
Since:
5.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    The version of a snapshot that belongs to no operation: one built for a caller and neither cached nor compared, such as the one returned by DataContext.currentSnapshot(..).
  • Method Summary

    Modifier and Type
    Method
    Description
    static long
    Returns the version of a new operation, greater than any version returned before, and never NONE.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NONE

      public static final long NONE
      The version of a snapshot that belongs to no operation: one built for a caller and neither cached nor compared, such as the one returned by DataContext.currentSnapshot(..). It is also the version of an object that was never loaded from or committed as a snapshot.
      See Also:
  • Method Details

    • next

      public static long next()
      Returns the version of a new operation, greater than any version returned before, and never NONE.