Class UserTypeVersionJavaTypeWrapper<J>

java.lang.Object
org.hibernate.type.internal.UserTypeJavaTypeWrapper<J>
org.hibernate.type.internal.UserTypeVersionJavaTypeWrapper<J>
All Implemented Interfaces:
Serializable, BasicJavaType<J>, JavaType<J>, VersionJavaType<J>

public class UserTypeVersionJavaTypeWrapper<J> extends UserTypeJavaTypeWrapper<J> implements VersionJavaType<J>
See Also:
  • Constructor Details

    • UserTypeVersionJavaTypeWrapper

      public UserTypeVersionJavaTypeWrapper(UserVersionType<J> userType)
  • Method Details

    • seed

      public J seed(Long length, Integer precision, Integer scale, SharedSessionContractImplementor session)
      Description copied from interface: VersionJavaType
      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.

      Specified by:
      seed in interface VersionJavaType<J>
      Parameters:
      length - The length of the type
      precision - The precision of the type
      scale - The scale of the type
      session - The session from which this request originates.
      Returns:
      an instance of the type
    • next

      public J next(J current, Long length, Integer precision, Integer scale, SharedSessionContractImplementor session)
      Description copied from interface: VersionJavaType
      Increment the version.
      Specified by:
      next in interface VersionJavaType<J>
      Parameters:
      current - the current version
      length - The length of the type
      precision - The precision of the type
      scale - The scale of the type
      session - The session from which this request originates.
      Returns:
      an instance of the type