Class ContextStackAttributeConverter
- java.lang.Object
-
- org.apache.logging.log4j.core.appender.db.jpa.converter.ContextStackAttributeConverter
-
- All Implemented Interfaces:
javax.persistence.AttributeConverter<ThreadContext.ContextStack,java.lang.String>
public class ContextStackAttributeConverter extends java.lang.Object implements javax.persistence.AttributeConverter<ThreadContext.ContextStack,java.lang.String>
A JPA 2.1 attribute converter forThreadContext.ContextStack
s inLogEvent
s. This converter is only capable of converting toString
s. TheconvertToEntityAttribute(String)
method throws anUnsupportedOperationException
. If you need to support converting to an entity attribute, you should use theContextStackJsonAttributeConverter
for conversion both ways.
-
-
Constructor Summary
Constructors Constructor Description ContextStackAttributeConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
convertToDatabaseColumn(ThreadContext.ContextStack contextStack)
ThreadContext.ContextStack
convertToEntityAttribute(java.lang.String s)
-
-
-
Method Detail
-
convertToDatabaseColumn
public java.lang.String convertToDatabaseColumn(ThreadContext.ContextStack contextStack)
- Specified by:
convertToDatabaseColumn
in interfacejavax.persistence.AttributeConverter<ThreadContext.ContextStack,java.lang.String>
-
convertToEntityAttribute
public ThreadContext.ContextStack convertToEntityAttribute(java.lang.String s)
- Specified by:
convertToEntityAttribute
in interfacejavax.persistence.AttributeConverter<ThreadContext.ContextStack,java.lang.String>
-
-