Package org.hibernate.usertype
Interface UserVersionType<T>
-
- All Superinterfaces:
Comparator<T>,UserType<T>
public interface UserVersionType<T> extends UserType<T>, Comparator<T>
A user type that may be used for a version property
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Tnext(T current, SharedSessionContractImplementor session)Increment the version.Tseed(SharedSessionContractImplementor session)Generate an initial version.-
Methods inherited from interface java.util.Comparator
compare, equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Methods inherited from interface org.hibernate.usertype.UserType
assemble, deepCopy, disassemble, equals, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getJdbcType, getSqlType, getValueConverter, hashCode, isMutable, nullSafeGet, nullSafeSet, replace, returnedClass
-
-
-
-
Method Detail
-
seed
T seed(SharedSessionContractImplementor session)
Generate an initial version.- Parameters:
session- The session from which this request originates. May be null; currently this only happens during startup when trying to determine the "unsaved value" of entities.- Returns:
- an instance of the type
-
next
T next(T current, SharedSessionContractImplementor session)
Increment the version.- Parameters:
session- The session from which this request originates.current- the current version- Returns:
- an instance of the type
-
-