Package org.hibernate.type
Interface VersionType<T>
-
- All Superinterfaces:
java.io.Serializable
,Type
- All Known Implementing Classes:
BinaryType
,ByteType
,CalendarType
,CustomType
,DbTimestampType
,InstantType
,IntegerType
,LocalDateTimeType
,LongType
,OffsetDateTimeType
,RowVersionType
,ShortType
,TimestampType
,ZonedDateTimeType
public interface VersionType<T> extends Type
Additional contract for types which may be used to version (and optimistic lock) data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Comparator<T>
getComparator()
Get a comparator for version values.T
next(T current, SharedSessionContractImplementor session)
Increment the version.T
seed(SharedSessionContractImplementor session)
Generate an initial version.-
Methods inherited from interface org.hibernate.type.Type
assemble, beforeAssemble, compare, deepCopy, defaultSizes, dictatedSizes, disassemble, getColumnSpan, getHashCode, getHashCode, getName, getReturnedClass, getSemiResolvedType, hydrate, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, nullSafeGet, nullSafeGet, nullSafeSet, nullSafeSet, replace, replace, resolve, resolve, semiResolve, sqlTypes, toColumnNullness, toLoggableString
-
-
-
-
Method Detail
-
seed
T seed(SharedSessionContractImplementor session)
Generate an initial version.- Parameters:
session
- The session from which this request originates.- 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
-
getComparator
java.util.Comparator<T> getComparator()
Get a comparator for version values.- Returns:
- The comparator to use to compare different version values.
-
-