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 interfaceVersionJavaType<T>extendsJavaType<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 Tnext(T current,Long length,Integer precision,Integer scale,SharedSessionContractImplementor session)Increment the version.Tseed(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,getCheckCondition,getComparator,getDefaultSqlLength,getDefaultSqlPrecision,getDefaultSqlScale,getDefaultValue,getJavaType,getJavaTypeClass,getLongSqlLength,getMutabilityPlan,getRecommendedJdbcType,getReplacement,getTypeName,isInstance,isTemporalType,isWider,toString,unwrap,useObjectEqualsHashCode,wrap
Method Detail
seed
T seed(Long length,Integer precision,Integer scale,SharedSessionContractImplementor session)
Generate an initial version.Note that this operation is only used when the program sets a null or negative number as the value of the entity version field. It is not called when the program sets the version field to a sensible-looking 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