Interface PropertyValueConverter<DV,SV,C extends ValueConversionContext<? extends PersistentProperty<?>>>

Type Parameters:
DV - domain-specific type.
SV - store-native type.
C - the store specific conversion context.
All Known Implementing Classes:
PropertyValueConverter.FunctionPropertyValueConverter, PropertyValueConverter.ObjectToObjectPropertyValueConverter

public interface PropertyValueConverter<DV,SV,C extends ValueConversionContext<? extends PersistentProperty<?>>>
PropertyValueConverter provides a symmetric way of converting certain properties from domain to store-specific values.

A PropertyValueConverter is, other than a ReadingConverter or WritingConverter, only applied to special annotated fields which allows a fine-grained conversion of certain values within a specific context.

Since:
2.7
Author:
Christoph Strobl
  • Method Details

    • read

      @Nullable DV read(@Nullable SV value, C context)
      Convert the given store specific value into it's domain value representation. Typically, a read operation.
      Parameters:
      value - can be null.
      context - never null.
      Returns:
      the converted value. Can be null.
    • write

      @Nullable SV write(@Nullable DV value, C context)
      Convert the given domain-specific value into it's native store representation. Typically, a write operation.
      Parameters:
      value - can be null.
      context - never null.
      Returns:
      the converted value. Can be null.