Package org.hibernate.metamodel.mapping
Interface JdbcMapping
- All Superinterfaces:
JdbcMappingContainer
,MappingType
- All Known Subinterfaces:
AdjustableBasicType<J>
,BasicPluralType<C,
,E> BasicType<T>
,ConvertedBasicType<J>
,DiscriminatorType<O>
- All Known Implementing Classes:
AbstractSingleColumnStandardBasicType
,AbstractStandardBasicType
,BasicArrayType
,BasicCollectionType
,BasicTypeImpl
,BasicTypeImpl
,BottomType
,ConvertedBasicArrayType
,ConvertedBasicCollectionType
,ConvertedBasicTypeImpl
,CustomMutabilityConvertedBasicTypeImpl
,CustomMutabilityConvertedPrimitiveBasicTypeImpl
,CustomType
,DiscriminatorType
,DiscriminatorTypeImpl
,ImmutableNamedBasicTypeImpl
,JavaObjectType
,NamedBasicTypeImpl
,NullType
,PrimitiveBasicTypeImpl
,QueryParameterJavaObjectType
,SerializableToBlobType
,SerializableType
,StandardBasicTypeTemplate
Describes the mapping for things which can be expressed in a SQL query.
Generally speaking this models a column. However, it can also model SQL tuples as well
This includes details such as
- the Java type of the mapping
- the JDBC type of the mapping
- how to read values from result-sets as well as callable parameters
- how to write values to JDBC statements
Some mappings will have an associated value converter. The readers and writers for such mappings will already incorporate those conversions
Some mappings support usage as SQL literals. Such mappings will return a non-null literal formatter which handles formatting values as a SQL literal
-
Method Summary
Modifier and TypeMethodDescriptiondefault Object
convertToDomainValue
(Object value) default Object
convertToRelationalValue
(Object value) default int
forEachJdbcType
(int offset, IndexedConsumer<JdbcMapping> action) Visit each JdbcMapping starting from the given offsetdefault int
forEachJdbcType
(IndexedConsumer<JdbcMapping> action) Visit each of JdbcMappingdefault CastType
The descriptor for the Java type represented by this expressible typedefault JavaType<?>
default JdbcLiteralFormatter
The strategy for formatting values of this expressible type to a SQL literal.default JdbcMapping
getJdbcMapping
(int index) The descriptor for the SQL type represented by this expressible typedefault int
The number of JDBC mappingsThe strategy for binding values of this expressible type to JDBCPreparedStatement
s andCallableStatement
s.The strategy for extracting values of this expressible type from JDBC ResultSets, CallableStatements, etcdefault JavaType<?>
The descriptor descriptor for the mapped Java typedefault JdbcMapping
default BasicValueConverter
Returns the converter that this basic type uses for transforming from the domain type, to the relational type, ornull
if there is no conversion.
-
Method Details
-
getJavaTypeDescriptor
JavaType getJavaTypeDescriptor()The descriptor for the Java type represented by this expressible type -
getJdbcType
JdbcType getJdbcType()The descriptor for the SQL type represented by this expressible type -
getJdbcValueExtractor
ValueExtractor<?> getJdbcValueExtractor()The strategy for extracting values of this expressible type from JDBC ResultSets, CallableStatements, etc -
getJdbcValueBinder
ValueBinder getJdbcValueBinder()The strategy for binding values of this expressible type to JDBCPreparedStatement
s andCallableStatement
s. -
getCastType
-
getJdbcLiteralFormatter
The strategy for formatting values of this expressible type to a SQL literal. -
getMappedJavaType
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceMappingType
-
getJdbcJavaType
-
getValueConverter
Returns the converter that this basic type uses for transforming from the domain type, to the relational type, ornull
if there is no conversion. -
convertToRelationalValue
-
convertToDomainValue
-
getJdbcTypeCount
default int getJdbcTypeCount()Description copied from interface:JdbcMappingContainer
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
-
getJdbcMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
-
getSingleJdbcMapping
- Specified by:
getSingleJdbcMapping
in interfaceJdbcMappingContainer
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each of JdbcMapping- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
forEachJdbcType
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-