Class PrimitiveByteArrayJavaType

    • Constructor Detail

      • PrimitiveByteArrayJavaType

        public PrimitiveByteArrayJavaType()
    • 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 AbstractClassJavaType<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 the given value.
        Specified by:
        extractHashCode in interface JavaType<byte[]>
        Overrides:
        extractHashCode in class AbstractClassJavaType<byte[]>
        Parameters:
        bytes - The value for which to extract a hash code.
        Returns:
        The extracted hash code.
      • appendString

        public void appendString​(SqlAppender appender,
                                 byte[] bytes)
      • appendString

        public void appendString​(StringBuilder appender,
                                 byte[] bytes)
      • 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 JavaType<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.
      • seed

        public byte[] seed​(Long length,
                           Integer precision,
                           Integer scale,
                           SharedSessionContractImplementor session)
        Description copied from interface: VersionJavaType
        Generate an initial version.
        Specified by:
        seed in interface VersionJavaType<byte[]>
        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 byte[] next​(byte[] current,
                           Long length,
                           Integer precision,
                           Integer scale,
                           SharedSessionContractImplementor session)
        Description copied from interface: VersionJavaType
        Increment the version.
        Specified by:
        next in interface VersionJavaType<byte[]>
        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