Tabnine Logo
TimestampLockingPolicy.isNewerVersion
Code IndexAdd Tabnine to your IDE (free)

How to use
isNewerVersion
method
in
org.eclipse.persistence.descriptors.TimestampLockingPolicy

Best Java code snippets using org.eclipse.persistence.descriptors.TimestampLockingPolicy.isNewerVersion (Showing top 6 results out of 315)

origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Compares the value with the value from the object (or cache).
 * Will return true if the currentValue is newer than the domainObject.
 */
@Override
public boolean isNewerVersion(Object currentValue, Object domainObject, Object primaryKey, AbstractSession session) {
  java.sql.Timestamp writeLockFieldValue;
  java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)currentValue;
  if (isStoredInCache()) {
    writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor());
  } else {
    writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject);
  }
  return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Compares the value with the value from the object (or cache).
 * Will return true if the currentValue is newer than the domainObject.
 */
public boolean isNewerVersion(Object currentValue, Object domainObject, java.util.Vector primaryKey, AbstractSession session) {
  java.sql.Timestamp writeLockFieldValue;
  java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)currentValue;
  if (isStoredInCache()) {
    writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor());
  } else {
    writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject);
  }
  return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Compares the value with the value from the object (or cache).
 * Will return true if the currentValue is newer than the domainObject.
 */
@Override
public boolean isNewerVersion(Object currentValue, Object domainObject, Object primaryKey, AbstractSession session) {
  java.sql.Timestamp writeLockFieldValue;
  java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)currentValue;
  if (isStoredInCache()) {
    writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor());
  } else {
    writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject);
  }
  return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue);
}
origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * Compares the value from the row and from the object (or cache).
 * Will return true if the row is newer than the object.
 */
public boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, java.util.Vector primaryKey, AbstractSession session) {
  java.sql.Timestamp writeLockFieldValue;
  java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)session.getDatasourcePlatform().convertObject(databaseRow.get(getWriteLockField()), ClassConstants.TIMESTAMP);
  if (isStoredInCache()) {
    writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor());
  } else {
    writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject);
  }
  
  return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue);
}
 
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * Compares the value from the row and from the object (or cache).
 * Will return true if the row is newer than the object.
 */
@Override
public boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, Object primaryKey, AbstractSession session) {
  java.sql.Timestamp writeLockFieldValue;
  java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)session.getDatasourcePlatform().convertObject(databaseRow.get(getWriteLockField()), ClassConstants.TIMESTAMP);
  if (isStoredInCache()) {
    writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor());
  } else {
    writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject);
  }
  return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue);
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * Compares the value from the row and from the object (or cache).
 * Will return true if the row is newer than the object.
 */
@Override
public boolean isNewerVersion(AbstractRecord databaseRow, Object domainObject, Object primaryKey, AbstractSession session) {
  java.sql.Timestamp writeLockFieldValue;
  java.sql.Timestamp newWriteLockFieldValue = (java.sql.Timestamp)session.getDatasourcePlatform().convertObject(databaseRow.get(getWriteLockField()), ClassConstants.TIMESTAMP);
  if (isStoredInCache()) {
    writeLockFieldValue = (java.sql.Timestamp)session.getIdentityMapAccessorInstance().getWriteLockValue(primaryKey, domainObject.getClass(), getDescriptor());
  } else {
    writeLockFieldValue = (java.sql.Timestamp)lockValueFromObject(domainObject);
  }
  
  return isNewerVersion(newWriteLockFieldValue, writeLockFieldValue);
}
 
org.eclipse.persistence.descriptorsTimestampLockingPolicyisNewerVersion

Javadoc

INTERNAL: Compares two values. Will return true if the firstLockFieldValue is newer than the secondWriteLockFieldValue.

Popular methods of TimestampLockingPolicy

  • <init>
    INTERNAL: Create a new TimestampLockingPolicy. Defaults to using the time retrieved from the server.
  • getDescriptor
  • getInitialWriteValue
    INTERNAL: returns the initial locking value
  • getWriteLockField
  • isStoredInCache
  • lockValueFromObject
  • storeInCache
  • storeInObject
  • useLocalTime
    PUBLIC: set this policy to get the time from the local machine.
  • useServerTime
    PUBLIC: set this policy to get the time from the server.
  • usesLocalTime
    PUBLIC: Return true if policy uses local time.
  • usesServerTime
    PUBLIC: Return true if policy uses server time.
  • usesLocalTime,
  • usesServerTime

Popular in Java

  • Finding current android device location
  • startActivity (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getApplicationContext (Context)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • ImageIO (javax.imageio)
  • JTextField (javax.swing)
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now