com.vladmihalcea.hibernate.type.json.JsonStringType Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hibernate-types-60 Show documentation
Show all versions of hibernate-types-60 Show documentation
Hibernate ORM 6.0 extra Types
package com.vladmihalcea.hibernate.type.json;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.vladmihalcea.hibernate.type.MutableDynamicParameterizedType;
import com.vladmihalcea.hibernate.type.json.internal.JsonJavaTypeDescriptor;
import com.vladmihalcea.hibernate.type.json.internal.JsonStringJdbcTypeDescriptor;
import com.vladmihalcea.hibernate.type.util.Configuration;
import com.vladmihalcea.hibernate.type.util.ObjectMapperWrapper;
import java.lang.reflect.Type;
/**
*
* Maps any given Java object on a JSON column type that is managed via {@link java.sql.PreparedStatement#setString(int, String)} at JDBC Driver level.
*
*
* - If you are using Oracle, you can use this {@link JsonStringType} to map a {@code VARCHAR2} column type storing JSON. For more details, check out this article on vladmihalcea.com.
*
* -
* If you are using SQL Server, you can use this {@link JsonStringType} to map an {@code NVARCHAR} column type storing JSON. For more details, check out this article on vladmihalcea.com.
*
* -
* If you are using MySQL, you can use this {@link JsonStringType} to map the {@code json} column type. For more details, check out this article on vladmihalcea.com.
*
* -
* If you are using PostgreSQL, then you should NOT use this {@link JsonStringType}. You should use {@link JsonBinaryType} instead. 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 {@link JsonType} instead.
*
*
* @author Vlad Mihalcea
*/
public class JsonStringType extends MutableDynamicParameterizedType