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,ConvertedBasicArrayType,ConvertedBasicCollectionType,ConvertedBasicTypeImpl,CustomMutabilityConvertedBasicTypeImpl,CustomType,DiscriminatorType,DiscriminatorTypeImpl,ImmutableNamedBasicTypeImpl,JavaObjectType,NamedBasicTypeImpl,NullType,SerializableToBlobType,SerializableType,StandardBasicTypeTemplate
public interface JdbcMapping extends MappingType, JdbcMappingContainer
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
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default ObjectconvertToDomainValue(Object value)default ObjectconvertToRelationalValue(Object value)default intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetdefault intforEachJdbcType(IndexedConsumer<JdbcMapping> action)Visit each of JdbcMappingdefault CastTypegetCastType()JavaTypegetJavaTypeDescriptor()The descriptor for the Java type represented by this expressible typedefault JavaType<?>getJdbcJavaType()default JdbcLiteralFormattergetJdbcLiteralFormatter()The strategy for formatting values of this expressible type to a SQL literal.default JdbcMappinggetJdbcMapping(int index)default List<JdbcMapping>getJdbcMappings()Deprecated, for removal: This API element is subject to removal in a future version.JdbcTypegetJdbcType()The descriptor for the SQL type represented by this expressible typedefault intgetJdbcTypeCount()The number of JDBC mappingsValueBindergetJdbcValueBinder()The strategy for binding values of this expressible type to JDBCPreparedStatements andCallableStatements.ValueExtractor<?>getJdbcValueExtractor()The strategy for extracting values of this expressible type from JDBC ResultSets, CallableStatements, etcdefault JavaType<?>getMappedJavaType()The descriptor descriptor for the mapped Java typedefault JdbcMappinggetSingleJdbcMapping()default BasicValueConvertergetValueConverter()Returns the converter that this basic type uses for transforming from the domain type, to the relational type, ornullif there is no conversion.
-
-
-
Method Detail
-
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 JDBCPreparedStatements andCallableStatements.
-
getCastType
default CastType getCastType()
-
getJdbcLiteralFormatter
@Incubating default JdbcLiteralFormatter getJdbcLiteralFormatter()
The strategy for formatting values of this expressible type to a SQL literal.
-
getMappedJavaType
default JavaType<?> getMappedJavaType()
Description copied from interface:MappingTypeThe descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceMappingType
-
getJdbcJavaType
@Incubating default JavaType<?> getJdbcJavaType()
-
getValueConverter
@Incubating default BasicValueConverter getValueConverter()
Returns the converter that this basic type uses for transforming from the domain type, to the relational type, ornullif there is no conversion.
-
getJdbcTypeCount
default int getJdbcTypeCount()
Description copied from interface:JdbcMappingContainerThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer
-
getJdbcMappings
@Deprecated(forRemoval=true) default List<JdbcMapping> getJdbcMappings()
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:JdbcMappingContainerThe list of JDBC mappings- Specified by:
getJdbcMappingsin interfaceJdbcMappingContainer
-
getJdbcMapping
default JdbcMapping getJdbcMapping(int index)
- Specified by:
getJdbcMappingin interfaceJdbcMappingContainer
-
getSingleJdbcMapping
default JdbcMapping getSingleJdbcMapping()
- Specified by:
getSingleJdbcMappingin interfaceJdbcMappingContainer
-
forEachJdbcType
default int forEachJdbcType(IndexedConsumer<JdbcMapping> action)
Description copied from interface:JdbcMappingContainerVisit each of JdbcMapping- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
forEachJdbcType
default int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
-