Class RowVersionJavaTypeDescriptor

    • Constructor Detail

      • RowVersionJavaTypeDescriptor

        public RowVersionJavaTypeDescriptor()
    • Method Detail

      • areEqual

        public boolean areEqual​(byte[] one,
                                byte[] another)
        Description copied from interface: JavaType
        Determine if two instances are equal
        Specified by:
        areEqual in interface JavaType<byte[]>
        Overrides:
        areEqual in class AbstractClassJavaTypeDescriptor<byte[]>
        Parameters:
        one - One instance
        another - The other instance
        Returns:
        True if the two are considered equal; false otherwise.
      • extractHashCode

        public int extractHashCode​(byte[] bytes)
        Description copied from interface: JavaType
        Extract a proper hash code for this value.
        Specified by:
        extractHashCode in interface JavaType<byte[]>
        Overrides:
        extractHashCode in class AbstractClassJavaTypeDescriptor<byte[]>
        Parameters:
        bytes - The value for which to extract a hash code.
        Returns:
        The extracted hash code.
      • unwrap

        public <X> X unwrap​(byte[] value,
                            Class<X> type,
                            WrapperOptions options)
        Description copied from interface: JavaType
        Unwrap an instance of our handled Java type into the requested type.

        As an example, if this is a JavaTypeDescriptor<Integer> and we are asked to unwrap the Integer value as a Long we would return something like Long.valueOf( value.longValue() ).

        Intended use is during PreparedStatement binding.

        Specified by:
        unwrap in interface JavaType<byte[]>
        Type Parameters:
        X - The conversion type.
        Parameters:
        value - The value to unwrap
        type - The type as which to unwrap
        options - The options
        Returns:
        The unwrapped value.
      • wrap

        public <X> byte[] wrap​(X value,
                               WrapperOptions options)
        Description copied from interface: JavaType
        Wrap a value as our handled Java type.

        Intended use is during ResultSet extraction.

        Specified by:
        wrap in interface JavaType<byte[]>
        Type Parameters:
        X - The conversion type.
        Parameters:
        value - The value to wrap.
        options - The options
        Returns:
        The wrapped value.
      • next

        public byte[] next​(byte[] current,
                           SharedSessionContractImplementor session)
        Description copied from interface: VersionJavaType
        Increment the version.
        Specified by:
        next in interface VersionJavaType<byte[]>
        Parameters:
        current - the current version
        session - The session from which this request originates.
        Returns:
        an instance of the type