Interface VersionJavaType<T>
-
- All Superinterfaces:
JavaType<T>
,Serializable
- All Known Implementing Classes:
ByteJavaType
,CalendarJavaType
,DateJavaType
,InstantJavaType
,IntegerJavaType
,JdbcTimestampJavaType
,LocalDateTimeJavaType
,LongJavaType
,OffsetDateTimeJavaType
,PrimitiveByteArrayJavaType
,RowVersionJavaType
,ShortJavaType
,UserTypeVersionJavaTypeWrapper
,ZonedDateTimeJavaType
public interface VersionJavaType<T> extends JavaType<T>
Additional contract for types which may be used to version (and optimistic lock) data.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.type.descriptor.java.JavaType
JavaType.CoercionContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description T
next(T current, Long length, Integer precision, Integer scale, SharedSessionContractImplementor session)
Increment the version.T
seed(Long length, Integer precision, Integer scale, SharedSessionContractImplementor session)
Generate an initial version.-
Methods inherited from interface org.hibernate.type.descriptor.java.JavaType
appendEncodedString, areEqual, coerce, createJavaType, createJavaType, extractHashCode, extractLoggableRepresentation, fromEncodedString, fromString, getComparator, getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getDefaultValue, getJavaType, getJavaTypeClass, getLongSqlLength, getMutabilityPlan, getRecommendedJdbcType, getReplacement, isInstance, isWider, toString, unwrap, wrap
-
-
-
-
Method Detail
-
seed
T seed(Long length, Integer precision, Integer scale, SharedSessionContractImplementor session)
Generate an initial version.- Parameters:
length
- The length of the typeprecision
- The precision of the typescale
- The scale of the typesession
- The session from which this request originates.- Returns:
- an instance of the type
-
next
T next(T current, Long length, Integer precision, Integer scale, SharedSessionContractImplementor session)
Increment the version.- Parameters:
current
- the current versionlength
- The length of the typeprecision
- The precision of the typescale
- The scale of the typesession
- The session from which this request originates.- Returns:
- an instance of the type
-
-