Codota Logo
Versioning.getVersion
Code IndexAdd Codota to your IDE (free)

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

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: hibernate/hibernate-orm

/**
 * Perform an SQL INSERT, and then retrieve a generated identifier.
 * <p/>
 * This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY,
 * select, etc).
 */
protected Serializable insert(
    final Object[] fields,
    final boolean[] notNull,
    String sql,
    final Object object,
    final SharedSessionContractImplementor session) throws HibernateException {
  if ( LOG.isTraceEnabled() ) {
    LOG.tracev( "Inserting entity: {0} (native id)", getEntityName() );
    if ( isVersioned() ) {
      LOG.tracev( "Version: {0}", Versioning.getVersion( fields, this ) );
    }
  }
  Binder binder = new Binder() {
    public void bindValues(PreparedStatement ps) throws SQLException {
      dehydrate( null, fields, notNull, propertyColumnInsertable, 0, ps, session, false );
    }
    public Object getEntity() {
      return object;
    }
  };
  return identityDelegate.performInsert( sql, session, binder );
}
origin: hibernate/hibernate-orm

private AbstractEntityInsertAction addInsertAction(
    Object[] values,
    Serializable id,
    Object entity,
    EntityPersister persister,
    boolean useIdentityColumn,
    EventSource source,
    boolean shouldDelayIdentityInserts) {
  if ( useIdentityColumn ) {
    EntityIdentityInsertAction insert = new EntityIdentityInsertAction(
        values, entity, persister, isVersionIncrementDisabled(), source, shouldDelayIdentityInserts
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
  else {
    Object version = Versioning.getVersion( values, persister );
    EntityInsertAction insert = new EntityInsertAction(
        id, values, entity, version, persister, isVersionIncrementDisabled(), source
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
}
origin: hibernate/hibernate-orm

  final LockMode lockMode,
  final SharedSessionContractImplementor session) {
final Object version = Versioning.getVersion( values, persister );
session.getPersistenceContext().addEntry(
    object,
origin: hibernate/hibernate-orm

/**
 * Make the entity "managed" by the persistence context.
 */
public final void makeEntityManaged() {
  nullifyTransientReferencesIfNotAlready();
  final Object version = Versioning.getVersion( getState(), getPersister() );
  getSession().getPersistenceContext().addEntity(
      getInstance(),
      ( getPersister().isMutable() ? Status.MANAGED : Status.READ_ONLY ),
      getState(),
      getEntityKey(),
      version,
      LockMode.WRITE,
      isExecuted,
      getPersister(),
      isVersionIncrementDisabled
  );
}
origin: hibernate/hibernate-orm

/**
 * Convenience method to retrieve an entities next version value
 */
private Object getNextVersion(FlushEntityEvent event) throws HibernateException {
  EntityEntry entry = event.getEntityEntry();
  EntityPersister persister = entry.getPersister();
  if ( persister.isVersioned() ) {
    Object[] values = event.getPropertyValues();
    if ( entry.isBeingReplicated() ) {
      return Versioning.getVersion( values, persister );
    }
    else {
      int[] dirtyProperties = event.getDirtyProperties();
      final boolean isVersionIncrementRequired = isVersionIncrementRequired(
          event,
          entry,
          persister,
          dirtyProperties
      );
      final Object nextVersion = isVersionIncrementRequired ?
          Versioning.increment( entry.getVersion(), persister.getVersionType(), event.getSession() ) :
          entry.getVersion(); //use the current version
      Versioning.setVersion( values, nextVersion, persister );
      return nextVersion;
    }
  }
  else {
    return null;
  }
}
origin: hibernate/hibernate-orm

    source
);
Object version = Versioning.getVersion( values, persister );
origin: hibernate/hibernate-orm

  );
version = Versioning.getVersion( values, subclassPersister );
LOG.tracef( "Cached Version : %s", version );
origin: hibernate/hibernate-orm

persister.processInsertGeneratedProperties( id, instance, getState(), session );
if ( persister.isVersionPropertyGenerated() ) {
  version = Versioning.getVersion( getState(), persister );
origin: hibernate/hibernate-orm

nextVersion = Versioning.getVersion( state, persister );
origin: hibernate/hibernate-orm

final Object version = Versioning.getVersion( hydratedState, persister );
final CacheEntry entry = persister.buildCacheEntry( entity, hydratedState, version, session );
final EntityDataAccess cache = persister.getCacheAccessStrategy();
origin: hibernate/hibernate-orm

protected interface InclusionChecker {
  boolean includeProperty(int propertyNumber);
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * Perform an SQL INSERT, and then retrieve a generated identifier.
 * <p/>
 * This form is used for PostInsertIdentifierGenerator-style ids (IDENTITY,
 * select, etc).
 */
protected Serializable insert(
    final Object[] fields,
    final boolean[] notNull,
    String sql,
    final Object object,
    final SessionImplementor session) throws HibernateException {
  if ( LOG.isTraceEnabled() ) {
    LOG.tracev( "Inserting entity: {0} (native id)", getEntityName() );
    if ( isVersioned() ) {
      LOG.tracev( "Version: {0}", Versioning.getVersion( fields, this ) );
    }
  }
  Binder binder = new Binder() {
    public void bindValues(PreparedStatement ps) throws SQLException {
      dehydrate( null, fields, notNull, propertyColumnInsertable, 0, ps, session );
    }
    public Object getEntity() {
      return object;
    }
  };
  return identityDelegate.performInsert( sql, session, binder );
}
origin: org.hibernate/com.springsource.org.hibernate

private AbstractEntityInsertAction addInsertAction(
    Object[] values,
    Serializable id,
    Object entity,
    EntityPersister persister,
    boolean useIdentityColumn,
    EventSource source,
    boolean shouldDelayIdentityInserts) {
  if ( useIdentityColumn ) {
    EntityIdentityInsertAction insert = new EntityIdentityInsertAction(
        values, entity, persister, isVersionIncrementDisabled(), source, shouldDelayIdentityInserts
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
  else {
    Object version = Versioning.getVersion( values, persister );
    EntityInsertAction insert = new EntityInsertAction(
        id, values, entity, version, persister, isVersionIncrementDisabled(), source
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
}
origin: org.hibernate/com.springsource.org.hibernate.core

private AbstractEntityInsertAction addInsertAction(
    Object[] values,
    Serializable id,
    Object entity,
    EntityPersister persister,
    boolean useIdentityColumn,
    EventSource source,
    boolean shouldDelayIdentityInserts) {
  if ( useIdentityColumn ) {
    EntityIdentityInsertAction insert = new EntityIdentityInsertAction(
        values, entity, persister, isVersionIncrementDisabled(), source, shouldDelayIdentityInserts
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
  else {
    Object version = Versioning.getVersion( values, persister );
    EntityInsertAction insert = new EntityInsertAction(
        id, values, entity, version, persister, isVersionIncrementDisabled(), source
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
}
origin: org.hibernate.orm/hibernate-core

private AbstractEntityInsertAction addInsertAction(
    Object[] values,
    Object id,
    Object entity,
    EntityTypeDescriptor descriptor,
    boolean useIdentityColumn,
    EventSource source,
    boolean shouldDelayIdentityInserts) {
  if ( useIdentityColumn ) {
    EntityIdentityInsertAction insert = new EntityIdentityInsertAction(
        values, entity, descriptor, isVersionIncrementDisabled(), source, shouldDelayIdentityInserts
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
  else {
    Object version = Versioning.getVersion( values, descriptor );
    EntityInsertAction insert = new EntityInsertAction(
        id, values, entity, version, descriptor, isVersionIncrementDisabled(), source
    );
    source.getActionQueue().addAction( insert );
    return insert;
  }
}
origin: org.hibernate/com.springsource.org.hibernate

/**
 * Make the entity "managed" by the persistence context.
 */
public final void makeEntityManaged() {
  nullifyTransientReferencesIfNotAlready();
  Object version = Versioning.getVersion( getState(), getPersister() );
  getSession().getPersistenceContext().addEntity(
      getInstance(),
      ( getPersister().isMutable() ? Status.MANAGED : Status.READ_ONLY ),
      getState(),
      getEntityKey(),
      version,
      LockMode.WRITE,
      isExecuted,
      getPersister(),
      isVersionIncrementDisabled,
      false
  );
}
origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Make the entity "managed" by the persistence context.
 */
public final void makeEntityManaged() {
  nullifyTransientReferencesIfNotAlready();
  Object version = Versioning.getVersion( getState(), getPersister() );
  getSession().getPersistenceContext().addEntity(
      getInstance(),
      ( getPersister().isMutable() ? Status.MANAGED : Status.READ_ONLY ),
      getState(),
      getEntityKey(),
      version,
      LockMode.WRITE,
      isExecuted,
      getPersister(),
      isVersionIncrementDisabled,
      false
  );
}
origin: org.hibernate.orm/hibernate-core

/**
 * Make the entity "managed" by the persistence context.
 */
public final void makeEntityManaged() {
  nullifyTransientReferencesIfNotAlready();
  final Object version = Versioning.getVersion( getState(), getEntityDescriptor() );
  getSession().getPersistenceContext().addEntity(
      getInstance(),
      ( getEntityDescriptor().getHierarchy().getMutabilityPlan().isMutable() ? Status.MANAGED : Status.READ_ONLY ),
      getState(),
      getEntityKey(),
      version,
      LockMode.WRITE,
      isExecuted,
      getEntityDescriptor(),
      isVersionIncrementDisabled
  );
}
origin: org.hibernate/com.springsource.org.hibernate

protected static interface InclusionChecker {
  public boolean includeProperty(int propertyNumber);
}
origin: org.hibernate/com.springsource.org.hibernate.core

protected static interface InclusionChecker {
  public boolean includeProperty(int propertyNumber);
}
org.hibernate.engine.internalVersioninggetVersion

Javadoc

Extract the optimistic locking value out of the entity state snapshot.

Popular methods of Versioning

  • 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?
  • seed
    Create an initial optimistic locking value according the VersionTypecontract for the version propert
  • 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

  • Reading from database using SQL prepared statement
  • setContentView (Activity)
  • getSupportFragmentManager (FragmentActivity)
  • onRequestPermissionsResult (Fragment)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • TreeSet (java.util)
    A NavigableSet implementation based on a TreeMap. The elements are ordered using their Comparable, o
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now