Class JsonNodeAttributeConverter

  • All Implemented Interfaces:
    javax.persistence.AttributeConverter<com.fasterxml.jackson.databind.JsonNode,​String>

    public class JsonNodeAttributeConverter
    extends Object
    implements javax.persistence.AttributeConverter<com.fasterxml.jackson.databind.JsonNode,​String>
    Converter that knows how to convert between a String and JsonNode.
    Author:
    Chris Cranford
    • Field Detail

      • mapper

        private static final com.fasterxml.jackson.databind.ObjectMapper mapper
    • Constructor Detail

      • JsonNodeAttributeConverter

        public JsonNodeAttributeConverter()
    • Method Detail

      • convertToDatabaseColumn

        public String convertToDatabaseColumn​(com.fasterxml.jackson.databind.JsonNode jsonNode)
        Specified by:
        convertToDatabaseColumn in interface javax.persistence.AttributeConverter<com.fasterxml.jackson.databind.JsonNode,​String>
      • convertToEntityAttribute

        public com.fasterxml.jackson.databind.JsonNode convertToEntityAttribute​(String databaseValue)
        Specified by:
        convertToEntityAttribute in interface javax.persistence.AttributeConverter<com.fasterxml.jackson.databind.JsonNode,​String>