Interface JdbcConverter
- All Superinterfaces:
RelationalConverter
- All Known Implementing Classes:
MappingJdbcConverter
A
JdbcConverter is responsible for converting for values to the native relational representation and vice
versa.- Since:
- 1.1
- Author:
- Jens Schauder, Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionClass<?>getColumnType(RelationalPersistentProperty property) The type to be used to store this property in the database.Returns the underlyingMappingContextused by the converter.getTargetSqlType(RelationalPersistentProperty property) The SQL type constant used when using this property as a parameter for a SQL statement.default <R> RreadAndResolve(Class<R> type, RowDocument source) Read aRowDocumentinto the requestedaggregate typeand resolve references by looking these up fromRelationResolver.default <R> RreadAndResolve(Class<R> type, RowDocument source, Identifier identifier) Read aRowDocumentinto the requestedaggregate typeand resolve references by looking these up fromRelationResolver.<R> RreadAndResolve(TypeInformation<R> type, RowDocument source, Identifier identifier) Read aRowDocumentinto the requestedaggregate typeand resolve references by looking these up fromRelationResolver.default JdbcValuewriteJdbcValue(@Nullable Object value, Class<?> type, SQLType sqlType) Convert a property value into aJdbcValuethat contains the converted value and information how to bind it to JDBC parameters.writeJdbcValue(@Nullable Object value, TypeInformation<?> type, SQLType sqlType) Convert a property value into aJdbcValuethat contains the converted value and information how to bind it to JDBC parameters.Methods inherited from interface org.springframework.data.relational.core.conversion.RelationalConverter
getConversionService, getEntityInstantiators, getPropertyAccessor, introspectProjection, project, read, readValue, writeValue
-
Method Details
-
writeJdbcValue
Convert a property value into aJdbcValuethat contains the converted value and information how to bind it to JDBC parameters.- Parameters:
value- a value as it is used in the object model. May benull.type- Class into which the value is to be converted. Must not benull.sqlType- theSQLTypeto be used if non is specified by a converter.- Returns:
- The converted value wrapped in a
JdbcValue. Guaranteed to be not null. - Since:
- 2.4
-
writeJdbcValue
Convert a property value into aJdbcValuethat contains the converted value and information how to bind it to JDBC parameters.- Parameters:
value- a value as it is used in the object model. May benull.type-TypeInformationinto which the value is to be converted. Must not benull.sqlType- theSQLTypeto be used if non is specified by a converter.- Returns:
- The converted value wrapped in a
JdbcValue. Guaranteed to be not null. - Since:
- 3.2.6
-
readAndResolve
Read aRowDocumentinto the requestedaggregate typeand resolve references by looking these up fromRelationResolver.- Type Parameters:
R- aggregate type.- Parameters:
type- target aggregate type.source- sourceRowDocument.- Returns:
- the converted object.
- Since:
- 3.2
- See Also:
-
readAndResolve
Read aRowDocumentinto the requestedaggregate typeand resolve references by looking these up fromRelationResolver.- Type Parameters:
R- aggregate type.- Parameters:
type- target aggregate type.source- sourceRowDocument.identifier- identifier chain.- Returns:
- the converted object.
- Since:
- 3.2
- See Also:
-
readAndResolve
Read aRowDocumentinto the requestedaggregate typeand resolve references by looking these up fromRelationResolver.- Type Parameters:
R- aggregate type.- Parameters:
type- target aggregate type.source- sourceRowDocument.identifier- identifier chain.- Returns:
- the converted object.
- Since:
- 3.2.6
- See Also:
-
getColumnType
The type to be used to store this property in the database. Multidimensional arrays are unwrapped to reflect a top-level array type (e.g.String[][]returnsString[]).- Returns:
- a
Classthat is suitable for usage with JDBC drivers. - Since:
- 2.0 TODO: Introduce variant returning TypeInformation.
- See Also:
-
getTargetSqlType
The SQL type constant used when using this property as a parameter for a SQL statement.- Returns:
- Must not be
null. - Since:
- 2.0
- See Also:
-
getMappingContext
RelationalMappingContext getMappingContext()Description copied from interface:RelationalConverterReturns the underlyingMappingContextused by the converter.- Specified by:
getMappingContextin interfaceRelationalConverter- Returns:
- never null
-