java.lang.Object
com.broadleafcommerce.paymenttransaction.provider.jpa.domain.support.AddressConverter
All Implemented Interfaces:
jakarta.persistence.AttributeConverter<Map<String,Address>,String>

public class AddressConverter extends Object implements jakarta.persistence.AttributeConverter<Map<String,Address>,String>
Used to convert a Map of Addresses to a serialized JSON object string representation for persistence and vice-versa.

This converter should be refactored to convert one single Address instead of a Map, it's kept as-is for now for backwards compatibility. To convert a Map of Addresses, AddressMapConverter should be used instead.

Author:
Samarth Dhruva (samarthd), Marie Standeven (marieStandeven)
  • Constructor Details

    • AddressConverter

      public AddressConverter(@Nullable @Qualifier("converterObjectMapper") com.fasterxml.jackson.databind.ObjectMapper objectMapper)
  • Method Details

    • convertToDatabaseColumn

      public String convertToDatabaseColumn(Map<String,Address> attribute)
      Specified by:
      convertToDatabaseColumn in interface jakarta.persistence.AttributeConverter<Map<String,Address>,String>
    • convertToEntityAttribute

      public Map<String,Address> convertToEntityAttribute(String dbData)
      Specified by:
      convertToEntityAttribute in interface jakarta.persistence.AttributeConverter<Map<String,Address>,String>
    • getObjectMapper

      public com.fasterxml.jackson.databind.ObjectMapper getObjectMapper()