Tabnine Logo
Versioning.seed
Code IndexAdd Tabnine to your IDE (free)

How to use
seed
method
in
org.hibernate.engine.internal.Versioning

Best Java code snippets using org.hibernate.engine.internal.Versioning.seed (Showing top 4 results out of 315)

origin: hibernate/hibernate-orm

fields[versionProperty] = seed( versionType, session );
return true;
origin: org.hibernate/com.springsource.org.hibernate

fields[versionProperty] = seed( versionType, session );
return true;
origin: org.hibernate/com.springsource.org.hibernate.core

fields[versionProperty] = seed( versionType, session );
return true;
origin: org.hibernate.orm/hibernate-core

/**
 * Create an initial optimistic locking value according the {@link VersionSupport}
 * contract for the version property <b>if required</b> and inject it into
 * the snapshot state.
 *
 * @return True if we injected a new version value into the fields array; false
 * otherwise.
 */
public static boolean seedVersion(
    Object[] fields,
    VersionDescriptor versionDescriptor,
    SharedSessionContractImplementor session) {
  final int versionPosition = versionDescriptor.getStateArrayPosition();
  final Object initialVersion = fields[ versionPosition ];
  if (
    initialVersion==null ||
    // This next bit is to allow for both unsaved-value="negative"
    // and for "older" behavior where version number did not get
    // seeded if it was already set in the object
    // TODO: shift it into unsaved-value strategy
    ( (initialVersion instanceof Number) && ( (Number) initialVersion ).longValue()<0 )
  ) {
    fields[versionPosition] = seed( versionDescriptor.getVersionSupport(), session );
    return true;
  }
  LOG.tracev( "Using initial version: {0}", initialVersion );
  return false;
}
org.hibernate.engine.internalVersioningseed

Javadoc

Create an initial optimistic locking value according the VersionSupportcontract for the version property.

Popular methods of Versioning

  • getVersion
    Extract the optimistic locking value out of the entity state snapshot.
  • increment
    Generate the next increment in the optimistic locking value according the VersionType contract for t
  • isVersionIncrementRequired
    Do we need to increment the version number, given the dirty properties?
  • seedVersion
    Create an initial optimistic locking value according the VersionSupportcontract for the version prop
  • setVersion
    Inject the optimistic locking value into the entity state snapshot.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • JCheckBox (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Top plugins for WebStorm
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