Module eclipselink

Class InstantLockingPolicy

All Implemented Interfaces:
Serializable, Cloneable, org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy

public class InstantLockingPolicy extends AbstractTsLockingPolicy<Instant>
Version policy used for optimistic locking with Instant field.
See Also:
  • Constructor Details

    • InstantLockingPolicy

      public InstantLockingPolicy()
      Create a new instance of version policy used for optimistic locking with Instant field. Defaults to using the time retrieved from the server.
    • InstantLockingPolicy

      public InstantLockingPolicy(String fieldName)
      Create a new instance of version policy used for optimistic locking with Instant field. Defaults to using the time retrieved from the server.
      Parameters:
      fieldName - the field where the write lock value will be stored
  • Method Details

    • getVersionDifference

      public int getVersionDifference(Object currentValue, Object domainObject, Object primaryKeys, org.eclipse.persistence.internal.sessions.AbstractSession session)
      Description copied from class: VersionLockingPolicy
      PUBLIC: Return the number of versions different between these objects.
      Specified by:
      getVersionDifference in interface org.eclipse.persistence.internal.descriptors.OptimisticLockingPolicy
      Overrides:
      getVersionDifference in class VersionLockingPolicy
      Parameters:
      currentValue - the new lock value
      domainObject - the object containing the version to be compared to
      primaryKeys - a vector containing the primary keys of the domainObject
      session - the session to be used with the comparison