Interface AttributeConverter<T,S>

Type Parameters:
T - domain value type
S - SQL scalar type declared by the mapping

public interface AttributeConverter<T,S>
Reflection-free conversion between a domain value and one SQL scalar. Implementations used by Convert must have a public no-argument constructor. Both methods receive null values and must define how to represent them.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromDatabase(S value)
    Converts a stored scalar to the entity field's domain type.
    toDatabase(T value)
    Converts an entity field value to its stored scalar representation.
  • Method Details

    • toDatabase

      S toDatabase(T value)
      Converts an entity field value to its stored scalar representation.
      Parameters:
      value - domain value, possibly null
      Returns:
      scalar value accepted by the declared storage type, or null
    • fromDatabase

      T fromDatabase(S value)
      Converts a stored scalar to the entity field's domain type.
      Parameters:
      value - stored value, possibly null
      Returns:
      reconstructed domain value, or null