Class JsonNodeBinaryType

All Implemented Interfaces:
org.hibernate.metamodel.mapping.BasicValuedMapping, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.SqlExpressible, org.hibernate.metamodel.mapping.ValueMapping, org.hibernate.query.BindableType<com.fasterxml.jackson.databind.JsonNode>, org.hibernate.query.sqm.SqmExpressible<com.fasterxml.jackson.databind.JsonNode>, org.hibernate.type.descriptor.java.JavaTypedExpressible, org.hibernate.usertype.DynamicParameterizedType, org.hibernate.usertype.ParameterizedType, org.hibernate.usertype.UserType<com.fasterxml.jackson.databind.JsonNode>

public class JsonNodeBinaryType extends MutableDynamicParameterizedType<com.fasterxml.jackson.databind.JsonNode,JsonBinaryJdbcTypeDescriptor,JsonNodeJavaTypeDescriptor>

Maps a Jackson JsonNode object on a JSON column type that is managed via PreparedStatement.setObject(int, Object) at JDBC Driver level.

For instance, if you are using PostgreSQL, you can use the JsonNodeBinaryType to map both jsonb and json column types to a Jackson JsonNode object.

For more details about how to use it, check out this article on vladmihalcea.com.

If you want to use a more portable Hibernate Type that can work on Oracle, SQL Server, PostgreSQL, MySQL, or H2 without any configuration changes, then you should use the JsonType instead.

Author:
Vlad Mihalcea
  • Field Details

  • Constructor Details

    • JsonNodeBinaryType

      public JsonNodeBinaryType()
    • JsonNodeBinaryType

      public JsonNodeBinaryType(JsonConfiguration configuration)
    • JsonNodeBinaryType

      public JsonNodeBinaryType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext)
    • JsonNodeBinaryType

      public JsonNodeBinaryType(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
    • JsonNodeBinaryType

      public JsonNodeBinaryType(ObjectMapperWrapper objectMapperWrapper)
  • Method Details

    • getName

      public String getName()