Class JsonJdbcType
- java.lang.Object
-
- org.hibernate.type.descriptor.jdbc.JsonJdbcType
-
- All Implemented Interfaces:
Serializable
,AggregateJdbcType
,JdbcType
- Direct Known Subclasses:
AbstractPostgreSQLJsonPGObjectType
,H2FormatJsonJdbcType
,JsonAsStringJdbcType
,MySQLCastingJsonJdbcType
,PostgreSQLCastingJsonJdbcType
public class JsonJdbcType extends Object implements AggregateJdbcType
Specialized type mapping forJSON
and the JSON SQL data type.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static JsonJdbcType
INSTANCE
Singleton access
-
Constructor Summary
Constructors Modifier Constructor Description protected
JsonJdbcType(EmbeddableMappingType embeddableMappingType)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.jdbc.JdbcType
appendWriteExpression, getCastType, getCheckCondition, getDdlTypeCode, getFriendlyName, getJdbcRecommendedJavaTypeMapping, getPreferredJavaTypeClass, isBinary, isDecimal, isFloat, isInteger, isInterval, isLob, isLobOrLong, isNationalized, isNumber, isString, isTemporal, registerOutParameter, registerOutParameter, wrapTopLevelSelectionExpression, wrapWriteExpression
-
-
-
-
Field Detail
-
INSTANCE
public static final JsonJdbcType INSTANCE
Singleton access
-
-
Constructor Detail
-
JsonJdbcType
protected JsonJdbcType(EmbeddableMappingType embeddableMappingType)
-
-
Method Detail
-
getJdbcTypeCode
public int getJdbcTypeCode()
Description copied from interface:JdbcType
The JDBC type code used when interacting with JDBC APIs.For example, it's used when calling
PreparedStatement.setNull(int, int)
.- Specified by:
getJdbcTypeCode
in interfaceJdbcType
- Returns:
- a JDBC type code
-
getDefaultSqlTypeCode
public int getDefaultSqlTypeCode()
Description copied from interface:JdbcType
A JDBC type code that identifies the SQL column type.This value might be different from
JdbcType.getDdlTypeCode()
if the actual type e.g. JSON is emulated through a type like CLOB.- Specified by:
getDefaultSqlTypeCode
in interfaceJdbcType
- Returns:
- a JDBC type code
-
getJdbcLiteralFormatter
public <T> JdbcLiteralFormatter<T> getJdbcLiteralFormatter(JavaType<T> javaType)
Description copied from interface:JdbcType
Obtain a formatter object capable of rendering values of the given Java type as SQL literals of the type represented by this object.- Specified by:
getJdbcLiteralFormatter
in interfaceJdbcType
-
resolveAggregateJdbcType
public AggregateJdbcType resolveAggregateJdbcType(EmbeddableMappingType mappingType, String sqlType, RuntimeModelCreationContext creationContext)
- Specified by:
resolveAggregateJdbcType
in interfaceAggregateJdbcType
-
getEmbeddableMappingType
public EmbeddableMappingType getEmbeddableMappingType()
- Specified by:
getEmbeddableMappingType
in interfaceAggregateJdbcType
-
fromString
protected <X> X fromString(String string, JavaType<X> javaType, WrapperOptions options) throws SQLException
- Throws:
SQLException
-
createJdbcValue
public Object createJdbcValue(Object domainValue, WrapperOptions options) throws SQLException
- Specified by:
createJdbcValue
in interfaceAggregateJdbcType
- Throws:
SQLException
-
extractJdbcValues
public Object[] extractJdbcValues(Object rawJdbcValue, WrapperOptions options) throws SQLException
- Specified by:
extractJdbcValues
in interfaceAggregateJdbcType
- Throws:
SQLException
-
toString
protected <X> String toString(X value, JavaType<X> javaType, WrapperOptions options)
-
getBinder
public <X> ValueBinder<X> getBinder(JavaType<X> javaType)
Description copied from interface:JdbcType
Obtain a binder object capable of binding values of the given Java type to parameters of a JDBCPreparedStatement
.
-
getExtractor
public <X> ValueExtractor<X> getExtractor(JavaType<X> javaType)
Description copied from interface:JdbcType
Obtain an extractor object capable of extracting values of the given Java type from a JDBCResultSet
.- Specified by:
getExtractor
in interfaceJdbcType
- Parameters:
javaType
- The descriptor describing the types of Java values to be extracted- Returns:
- The appropriate extractor
-
-