Class JsonStringType
java.lang.Object
io.hypersistence.utils.hibernate.type.MutableType<T,JDBC,JAVA>
io.hypersistence.utils.hibernate.type.MutableDynamicParameterizedType<Object,JsonStringJdbcTypeDescriptor,JsonJavaTypeDescriptor>
io.hypersistence.utils.hibernate.type.json.JsonStringType
- 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<Object>,org.hibernate.query.sqm.SqmExpressible<Object>,org.hibernate.type.descriptor.java.JavaTypedExpressible,org.hibernate.usertype.DynamicParameterizedType,org.hibernate.usertype.ParameterizedType,org.hibernate.usertype.UserType<Object>
public class JsonStringType
extends MutableDynamicParameterizedType<Object,JsonStringJdbcTypeDescriptor,JsonJavaTypeDescriptor>
Maps any given Java object on a JSON column type that is managed via PreparedStatement.setString(int, String) at JDBC Driver level.
- If you are using Oracle, you can use this
JsonStringTypeto map aVARCHAR2column type storing JSON. For more details, check out this article on vladmihalcea.com. -
If you are using SQL Server, you can use this
JsonStringTypeto map anNVARCHARcolumn type storing JSON. For more details, check out this article on vladmihalcea.com. -
If you are using MySQL, you can use this
JsonStringTypeto map thejsoncolumn type. For more details, check out this article on vladmihalcea.com. -
If you are using PostgreSQL, then you should NOT use this
JsonStringType. You should useJsonBinaryTypeinstead. For more details, 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
ConstructorsConstructorDescriptionJsonStringType(com.fasterxml.jackson.databind.ObjectMapper objectMapper) JsonStringType(com.fasterxml.jackson.databind.ObjectMapper objectMapper, Type javaType) JsonStringType(JsonConfiguration configuration) JsonStringType(ObjectMapperWrapper objectMapperWrapper) JsonStringType(ObjectMapperWrapper objectMapperWrapper, Type javaType) JsonStringType(Type javaType) JsonStringType(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
-
JsonStringType
public JsonStringType() -
JsonStringType
-
JsonStringType
-
JsonStringType
public JsonStringType(org.hibernate.type.spi.TypeBootstrapContext typeBootstrapContext) -
JsonStringType
public JsonStringType(com.fasterxml.jackson.databind.ObjectMapper objectMapper) -
JsonStringType
-
JsonStringType
-
JsonStringType
-
-
Method Details
-
getName
-