Interface UserType

All Known Implementing Classes:
PrimitiveArrayToBinary

public interface UserType
This interface should be implemented by user-defined "types". A "type" class is not the actual property type - it is a class that knows how to serialize instances of another class to and from JDBC.

This interface
  • abstracts user code from future changes to the Type interface,
  • simplifies the implementation of custom types and
  • hides certain "internal" interfaces from user code.

Implementors must be immutable and must declare a public default constructor.

The actual class mapped by a UserType may be just about anything.

  • Method Details

    • returnedClass

      Class returnedClass()
      The class returned by nullSafeGet().
      Returns:
      Class
    • equals

      boolean equals(Object x, Object y)
      Compare two instances of the class mapped by this type for persistence "equality". Equality of the persistent state.
      Parameters:
      x -
      y -
      Returns:
      boolean
    • hashCode

      int hashCode(Object x)
      Get a hashcode for the instance, consistent with persistence "equality"
    • nullSafeGet

      Object nullSafeGet(InputStream value) throws IOException
      Retrieve an instance of the mapped class from a . Implementors should handle possibility of null values.
      Parameters:
      value - the value returned from the DBF file
      Returns:
      Object
      Throws:
      IOException
    • nullSafeSet

      void nullSafeSet(OutputStream stream, Object value) throws IOException
      Write an instance of the mapped class to a output stream. Implementors should handle possibility of null values. A multi-column type should be written to parameters starting from index.
      Parameters:
      stream - the stream to write the data to.
      value - the object to write
      Throws:
      IOException
    • setParameterValues

      void setParameterValues(Properties prprts) throws IOException
      Throws:
      IOException