Class AbstractSetConverter<T>

java.lang.Object
com.broadleafcommerce.common.jpa.converter.AbstractSetConverter<T>
All Implemented Interfaces:
javax.persistence.AttributeConverter<HashSet<T>,String>
Direct Known Subclasses:
CurrencySetConverter, StringSetConverter

public abstract class AbstractSetConverter<T> extends Object implements javax.persistence.AttributeConverter<HashSet<T>,String>
Converter used for converting an arbitrary HashSet type to String before persistence.
Author:
Nick Crum (ncrum)
  • Constructor Details

    • AbstractSetConverter

      public AbstractSetConverter(Class<T> elementType, @Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • AbstractSetConverter

      public AbstractSetConverter(Class<T> elementType, @Nullable com.fasterxml.jackson.databind.ObjectMapper objectMapper, boolean initIfNull)
  • Method Details

    • convertToDatabaseColumn

      public String convertToDatabaseColumn(HashSet<T> set)
      Specified by:
      convertToDatabaseColumn in interface javax.persistence.AttributeConverter<HashSet<T>,String>
    • convertToEntityAttribute

      public HashSet<T> convertToEntityAttribute(String mapJson)
      Specified by:
      convertToEntityAttribute in interface javax.persistence.AttributeConverter<HashSet<T>,String>
    • getObjectMapper

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