Class StringMapConverterBase<K,V,M extends Map<K,V>>

java.lang.Object
google.registry.persistence.converter.StringMapConverterBase<K,V,M>
All Implemented Interfaces:
javax.persistence.AttributeConverter<M,StringMapDescriptor.StringMap>
Direct Known Subclasses:
CurrencyToBillingConverter, RegistrarToRoleConverter, TimedTransitionPropertyConverterBase

public abstract class StringMapConverterBase<K,V,M extends Map<K,V>> extends Object implements javax.persistence.AttributeConverter<M,StringMapDescriptor.StringMap>
Base JPA converter for Map objects that are stored in a column with data type of hstore in the database.
  • Constructor Details

    • StringMapConverterBase

      public StringMapConverterBase()
  • Method Details

    • convertKeyToString

      protected abstract String convertKeyToString(K key)
    • convertValueToString

      protected abstract String convertValueToString(V value)
    • convertStringToKey

      protected abstract K convertStringToKey(String string)
    • convertStringToValue

      protected abstract V convertStringToValue(String string)
    • convertMapToDerivedType

      protected abstract M convertMapToDerivedType(Map<K,V> map)
    • convertToDatabaseColumn

      public StringMapDescriptor.StringMap convertToDatabaseColumn(M attribute)
      Specified by:
      convertToDatabaseColumn in interface javax.persistence.AttributeConverter<K,V>
    • convertToEntityAttribute

      public M convertToEntityAttribute(StringMapDescriptor.StringMap dbData)
      Specified by:
      convertToEntityAttribute in interface javax.persistence.AttributeConverter<K,V>