Save This Page
Home » hibernate-distribution-3.3.1.GA-dist » org.hibernate » engine » [javadoc | source]
org.hibernate.engine
public final class: Versioning [javadoc | source]
java.lang.Object
   org.hibernate.engine.Versioning
Utilities for dealing with optimisitic locking values.
Field Summary
public static final  int OPTIMISTIC_LOCK_NONE    Apply no optimistic locking 
public static final  int OPTIMISTIC_LOCK_VERSION    Apply optimisitc locking based on the defined version or timestamp property. 
public static final  int OPTIMISTIC_LOCK_ALL    Apply optimisitc locking based on the a current vs. snapshot comparison of all properties. 
public static final  int OPTIMISTIC_LOCK_DIRTY    Apply optimisitc locking based on the a current vs. snapshot comparison of dirty properties. 
Method from org.hibernate.engine.Versioning Summary:
getVersion,   increment,   isVersionIncrementRequired,   seedVersion,   setVersion
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.hibernate.engine.Versioning Detail:
 public static Object getVersion(Object[] fields,
    EntityPersister persister) 
    Extract the optimisitc locking value out of the entity state snapshot.
 public static Object increment(Object version,
    VersionType versionType,
    SessionImplementor session) 
    Generate the next increment in the optimisitc locking value according the VersionType contract for the version property.
 public static boolean isVersionIncrementRequired(int[] dirtyProperties,
    boolean hasDirtyCollections,
    boolean[] propertyVersionability) 
    Do we need to increment the version number, given the dirty properties?
 public static boolean seedVersion(Object[] fields,
    int versionProperty,
    VersionType versionType,
    SessionImplementor session) 
    Create an initial optimisitc locking value according the VersionType contract for the version property if required and inject it into the snapshot state.
 public static  void setVersion(Object[] fields,
    Object version,
    EntityPersister persister) 
    Inject the optimisitc locking value into the entity state snapshot.