congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
TimestampLockingPolicy.usesServerTime
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: org.eclipse.persistence/com.springsource.org.eclipse.persistence

/**
 * INTERNAL:
 * returns the initial locking value
 */
protected Object getInitialWriteValue(AbstractSession session) {
  if (usesLocalTime()) {
    return new Timestamp(System.currentTimeMillis());
  }
  if (usesServerTime()) {
    AbstractSession readSession = session.getSessionForClass(getDescriptor().getJavaClass());
    while (readSession.isUnitOfWork()) {
      readSession = ((UnitOfWorkImpl)readSession).getParent().getSessionForClass(getDescriptor().getJavaClass());
    }
    return readSession.getDatasourceLogin().getDatasourcePlatform().getTimestampFromServer(session, readSession.getName());
  }
  return null;
}
origin: org.eclipse.persistence/org.eclipse.persistence.core

/**
 * INTERNAL:
 * returns the initial locking value
 */
protected Object getInitialWriteValue(AbstractSession session) {
  if (usesLocalTime()) {
    return new Timestamp(System.currentTimeMillis());
  }
  if (usesServerTime()) {
    AbstractSession readSession = session.getSessionForClass(getDescriptor().getJavaClass());
    while (readSession.isUnitOfWork()) {
      readSession = ((UnitOfWorkImpl)readSession).getParent().getSessionForClass(getDescriptor().getJavaClass());
    }
    return readSession.getDatasourceLogin().getDatasourcePlatform().getTimestampFromServer(session, readSession.getName());
  }
  return null;
}
origin: com.haulmont.thirdparty/eclipselink

/**
 * INTERNAL:
 * returns the initial locking value
 */
protected Object getInitialWriteValue(AbstractSession session) {
  if (usesLocalTime()) {
    return new Timestamp(System.currentTimeMillis());
  }
  if (usesServerTime()) {
    AbstractSession readSession = session.getSessionForClass(getDescriptor().getJavaClass());
    while (readSession.isUnitOfWork()) {
      readSession = ((UnitOfWorkImpl)readSession).getParent().getSessionForClass(getDescriptor().getJavaClass());
    }
    return readSession.getDatasourceLogin().getDatasourcePlatform().getTimestampFromServer(session, readSession.getName());
  }
  return null;
}
org.eclipse.persistence.descriptorsTimestampLockingPolicyusesServerTime

Javadoc

PUBLIC: Return true if policy uses server time.

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
  • isNewerVersion
    INTERNAL: Compares the value from the row and from the object (or cache). Will return true if the ro
  • 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.
  • useServerTime,
  • usesLocalTime

Popular in Java

  • Updating database using SQL prepared statement
  • setContentView (Activity)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • runOnUiThread (Activity)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • LogFactory (org.apache.commons.logging)
    Factory for creating Log instances, with discovery and configuration features similar to that employ
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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