Class JsonNodeStringType
java.lang.Object
io.hypersistence.utils.hibernate.type.MutableType<T,JDBC,JAVA>
io.hypersistence.utils.hibernate.type.MutableDynamicParameterizedType<com.fasterxml.jackson.databind.JsonNode,JsonStringJdbcTypeDescriptor,JsonNodeJavaTypeDescriptor>
io.hypersistence.utils.hibernate.type.json.JsonNodeStringType
- 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 JsonNodeStringType
extends MutableDynamicParameterizedType<com.fasterxml.jackson.databind.JsonNode,JsonStringJdbcTypeDescriptor,JsonNodeJavaTypeDescriptor>
Maps a Jackson JsonNode object on a JSON column type that is managed via PreparedStatement.setString(int, String) at JDBC Driver level.
For instance, if you are using MySQL, you can use the JsonNodeStringType to map the json column type 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
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
org.hibernate.metamodel.mapping.Bindable.JdbcValuesConsumerNested classes/interfaces inherited from interface org.hibernate.usertype.DynamicParameterizedType
org.hibernate.usertype.DynamicParameterizedType.ParameterType -
Field Summary
FieldsFields inherited from interface org.hibernate.usertype.DynamicParameterizedType
ACCESS_TYPE, ENTITY, IS_DYNAMIC, IS_PRIMARY_KEY, PARAMETER_TYPE, PROPERTY, RETURNED_CLASS, XPROPERTY -
Constructor Summary
ConstructorsConstructorDescriptionJsonNodeStringType(com.fasterxml.jackson.databind.ObjectMapper objectMapper) JsonNodeStringType(JsonConfiguration configuration) JsonNodeStringType(ObjectMapperWrapper objectMapperWrapper) JsonNodeStringType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext) -
Method Summary
Methods inherited from class io.hypersistence.utils.hibernate.type.MutableDynamicParameterizedType
setParameterValuesMethods inherited from class io.hypersistence.utils.hibernate.type.MutableType
assemble, deepCopy, disassemble, disassemble, equals, forEachDisassembledJdbcValue, forEachJdbcType, getBindableJavaType, getConfiguration, getExpressibleJavaType, getJavaTypeDescriptor, getJdbcMapping, getJdbcTypeDescriptor, getMappedType, getSqlType, hashCode, isMutable, nullSafeGet, nullSafeSet, replace, returnedClassMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.metamodel.mapping.BasicValuedMapping
getJdbcMappings, getJdbcTypeCountMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, forEachJdbcValueMethods inherited from interface org.hibernate.query.sqm.SqmExpressible
isInstance, resolveExpressibleMethods inherited from interface org.hibernate.usertype.UserType
getDefaultSqlLength, getDefaultSqlPrecision, getDefaultSqlScale, getJdbcType, getValueConverterMethods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
treatAs
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
JsonNodeStringType
public JsonNodeStringType() -
JsonNodeStringType
-
JsonNodeStringType
public JsonNodeStringType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext) -
JsonNodeStringType
public JsonNodeStringType(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
JsonNodeStringType
-
-
Method Details
-
getName
-