Package org.hibernate.dialect
Class AbstractPostgreSQLStructJdbcType
- java.lang.Object
-
- org.hibernate.dialect.AbstractPostgreSQLStructJdbcType
-
- All Implemented Interfaces:
Serializable
,AggregateJdbcType
,JdbcType
- Direct Known Subclasses:
PostgreSQLStructCastingJdbcType
,PostgreSQLStructPGObjectJdbcType
public abstract class AbstractPostgreSQLStructJdbcType extends Object implements AggregateJdbcType
Implementation for serializing/deserializing an embeddable aggregate to/from the PostgreSQL component format. For regular queries, we select the individual struct elements because the PostgreSQL component format encoding is probably not very efficient.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractPostgreSQLStructJdbcType(EmbeddableMappingType embeddableMappingType, String typeName, int[] orderMapping)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
createJdbcValue(Object domainValue, WrapperOptions options)
Object[]
extractJdbcValues(Object rawJdbcValue, WrapperOptions options)
protected <X> X
fromString(String string, JavaType<X> javaType, WrapperOptions options)
EmbeddableMappingType
getEmbeddableMappingType()
<X> ValueExtractor<X>
getExtractor(JavaType<X> javaType)
<T> JavaType<T>
getJdbcRecommendedJavaTypeMapping(Integer precision, Integer scale, TypeConfiguration typeConfiguration)
int
getJdbcTypeCode()
The JDBC type code used when interacting with JDBC APIs.String
getTypeName()
protected <X> String
toString(X value, JavaType<X> javaType, WrapperOptions options)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.jdbc.AggregateJdbcType
resolveAggregateJdbcType
-
Methods inherited from interface org.hibernate.type.descriptor.jdbc.JdbcType
appendWriteExpression, getBinder, getCastType, getCheckCondition, getDdlTypeCode, getDefaultSqlTypeCode, getFriendlyName, getJdbcLiteralFormatter, getPreferredJavaTypeClass, isBinary, isDecimal, isFloat, isInteger, isInterval, isLob, isLobOrLong, isNationalized, isNumber, isString, isTemporal, registerOutParameter, registerOutParameter, wrapTopLevelSelectionExpression, wrapWriteExpression
-
-
-
-
Constructor Detail
-
AbstractPostgreSQLStructJdbcType
protected AbstractPostgreSQLStructJdbcType(EmbeddableMappingType embeddableMappingType, String typeName, int[] orderMapping)
-
-
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
-
getTypeName
public String getTypeName()
-
getEmbeddableMappingType
public EmbeddableMappingType getEmbeddableMappingType()
- Specified by:
getEmbeddableMappingType
in interfaceAggregateJdbcType
-
getJdbcRecommendedJavaTypeMapping
public <T> JavaType<T> getJdbcRecommendedJavaTypeMapping(Integer precision, Integer scale, TypeConfiguration typeConfiguration)
- Specified by:
getJdbcRecommendedJavaTypeMapping
in interfaceJdbcType
-
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
-
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)
-
-