Class ContextMapAttributeConverter

java.lang.Object
org.apache.logging.log4j.core.appender.db.jpa.converter.ContextMapAttributeConverter
All Implemented Interfaces:
javax.persistence.AttributeConverter<Map<String,String>,String>

public class ContextMapAttributeConverter extends Object implements javax.persistence.AttributeConverter<Map<String,String>,String>
A JPA 2.1 attribute converter for Map<String, String>s in LogEvents. This converter is only capable of converting to Strings. The convertToEntityAttribute(String) method throws an UnsupportedOperationException. If you need to support converting to an entity attribute, you should use the ContextMapJsonAttributeConverter for conversion both ways.
  • Constructor Details

    • ContextMapAttributeConverter

      public ContextMapAttributeConverter()
  • Method Details

    • convertToDatabaseColumn

      public String convertToDatabaseColumn(Map<String,String> contextMap)
      Specified by:
      convertToDatabaseColumn in interface javax.persistence.AttributeConverter<Map<String,String>,String>
    • convertToEntityAttribute

      public Map<String,String> convertToEntityAttribute(String s)
      Specified by:
      convertToEntityAttribute in interface javax.persistence.AttributeConverter<Map<String,String>,String>