org.apache.logging.log4j.core.appender.db.jpa.converter
Class ContextStackAttributeConverter

java.lang.Object
  extended by org.apache.logging.log4j.core.appender.db.jpa.converter.ContextStackAttributeConverter
All Implemented Interfaces:
AttributeConverter<org.apache.logging.log4j.ThreadContext.ContextStack,String>

public class ContextStackAttributeConverter
extends Object
implements 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
ContextStackAttributeConverter()
           
 
Method Summary
 String convertToDatabaseColumn(org.apache.logging.log4j.ThreadContext.ContextStack contextStack)
           
 org.apache.logging.log4j.ThreadContext.ContextStack convertToEntityAttribute(String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContextStackAttributeConverter

public ContextStackAttributeConverter()
Method Detail

convertToDatabaseColumn

public String convertToDatabaseColumn(org.apache.logging.log4j.ThreadContext.ContextStack contextStack)
Specified by:
convertToDatabaseColumn in interface AttributeConverter<org.apache.logging.log4j.ThreadContext.ContextStack,String>

convertToEntityAttribute

public org.apache.logging.log4j.ThreadContext.ContextStack convertToEntityAttribute(String s)
Specified by:
convertToEntityAttribute in interface AttributeConverter<org.apache.logging.log4j.ThreadContext.ContextStack,String>


Copyright © 1999-2014 Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.