Class ContextStackAttributeConverter
java.lang.Object
org.apache.logging.log4j.core.appender.db.jpa.converter.ContextStackAttributeConverter
- All Implemented Interfaces:
javax.persistence.AttributeConverter<org.apache.logging.log4j.ThreadContext.ContextStack,String>
public class ContextStackAttributeConverter
extends Object
implements javax.persistence.AttributeConverter<org.apache.logging.log4j.ThreadContext.ContextStack,String>
A JPA 2.1 attribute converter for
ThreadContext.ContextStacks 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 ContextStackJsonAttributeConverter for
conversion both ways.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertToDatabaseColumn(org.apache.logging.log4j.ThreadContext.ContextStack contextStack) org.apache.logging.log4j.ThreadContext.ContextStack
-
Constructor Details
-
ContextStackAttributeConverter
public ContextStackAttributeConverter()
-
-
Method Details
-
convertToDatabaseColumn
public String convertToDatabaseColumn(org.apache.logging.log4j.ThreadContext.ContextStack contextStack) - Specified by:
convertToDatabaseColumnin interfacejavax.persistence.AttributeConverter<org.apache.logging.log4j.ThreadContext.ContextStack,String>
-
convertToEntityAttribute
- Specified by:
convertToEntityAttributein interfacejavax.persistence.AttributeConverter<org.apache.logging.log4j.ThreadContext.ContextStack,String>
-