Package org.hibernate.type
Interface BasicType<T>
-
- All Superinterfaces:
BasicDomainType<T>
,BasicType<T>
,BasicValuedMapping
,Bindable
,BindableType<T>
,DomainType<T>
,JavaTypedExpressible
,JdbcMapping
,JdbcMappingContainer
,MappingModelExpressible
,MappingType
,OutputableType<T>
,ReturnableType<T>
,Serializable
,SimpleDomainType<T>
,SqlExpressible
,SqmExpressible<T>
,Type<T>
,Type
,ValueMapping
- All Known Subinterfaces:
AdjustableBasicType<J>
,BasicPluralType<C,E>
,ConvertedBasicType<J>
,DiscriminatorType<O>
- All Known Implementing Classes:
AbstractSingleColumnStandardBasicType
,AbstractStandardBasicType
,BasicArrayType
,BasicCollectionType
,BasicTypeImpl
,BottomType
,ConvertedBasicArrayType
,ConvertedBasicCollectionType
,ConvertedBasicTypeImpl
,CustomMutabilityConvertedBasicTypeImpl
,CustomMutabilityConvertedPrimitiveBasicTypeImpl
,CustomType
,DiscriminatorType
,DiscriminatorTypeImpl
,ImmutableNamedBasicTypeImpl
,JavaObjectType
,NamedBasicTypeImpl
,NullType
,QueryParameterJavaObjectType
,SerializableToBlobType
,SerializableType
,StandardBasicTypeTemplate
public interface BasicType<T> extends Type, BasicDomainType<T>, MappingType, BasicValuedMapping, JdbcMapping
Marker interface for basic types.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesBiConsumer<X,Y>, Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface jakarta.persistence.metamodel.Type
Type.PersistenceType
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default int
compare(Object x, Object y, SessionFactoryImplementor sessionFactory)
default Object
disassemble(Object value, SharedSessionContractImplementor session)
Breaks down a value ofJ
into its simple pieces.default <X,Y>
intforEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
LikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)
, but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping)
.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 String
getCheckCondition(String columnName, Dialect dialect)
The check constraint that should be added to the column definition in generated DDL.default JavaType<T>
getExpressibleJavaType()
The Java type descriptor for this expressibledefault JavaType<T>
getJavaTypeDescriptor()
The descriptor for the Java type represented by this expressible typedefault JdbcLiteralFormatter<T>
getJdbcLiteralFormatter()
The strategy for formatting values of this expressible type to a SQL literal.default JdbcMapping
getJdbcMapping()
Anything that is expressible at the SQL AST level would be of basic type.default JdbcMapping
getJdbcMapping(int index)
default int
getJdbcTypeCount()
The number of JDBC mappingsdefault ValueBinder<T>
getJdbcValueBinder()
The strategy for binding values of this expressible type to JDBCPreparedStatement
s andCallableStatement
s.default ValueExtractor<T>
getJdbcValueExtractor()
The strategy for extracting values of this expressible type from JDBC ResultSets, CallableStatements, etcdefault JavaType<T>
getMappedJavaType()
The descriptor descriptor for the mapped Java typedefault MappingType
getMappedType()
Descriptor for the type of this mappingString[]
getRegistrationKeys()
Get the names under which this type should be registered in the type registry.default JdbcMapping
getSingleJdbcMapping()
default BasicValueConverter<T,?>
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.-
Methods inherited from interface org.hibernate.metamodel.model.domain.BasicDomainType
areEqual, getPersistenceType
-
Methods inherited from interface org.hibernate.metamodel.mapping.BasicValuedMapping
addToCacheKey
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachDisassembledJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.model.domain.DomainType
getSqmType, getTupleLength
-
Methods inherited from interface org.hibernate.metamodel.mapping.JdbcMapping
convertToDomainValue, convertToRelationalValue, getCastType, getJdbcJavaType, getJdbcType
-
Methods inherited from interface org.hibernate.query.OutputableType
canDoExtraction, extract, extract, getJdbcType
-
Methods inherited from interface org.hibernate.metamodel.model.domain.SimpleDomainType
getBindableJavaType
-
Methods inherited from interface org.hibernate.query.sqm.SqmExpressible
getRelationalJavaType, getTypeName, isInstance, resolveExpressible
-
Methods inherited from interface jakarta.persistence.metamodel.Type
getJavaType
-
Methods inherited from interface org.hibernate.type.Type
assemble, beforeAssemble, compare, deepCopy, disassemble, disassemble, getColumnSpan, getHashCode, getHashCode, getName, getReturnedClass, getReturnedClassName, getSqlTypeCodes, getTypeForEqualsHashCode, isAnyType, isAssociationType, isCollectionType, isComponentType, isDirty, isDirty, isEntityType, isEqual, isEqual, isModified, isMutable, isSame, nullSafeSet, nullSafeSet, replace, replace, toColumnNullness, toLoggableString
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
treatAs
-
-
-
-
Method Detail
-
getRegistrationKeys
String[] getRegistrationKeys()
Get the names under which this type should be registered in the type registry.- Returns:
- The keys under which to register this type.
-
getMappedType
default MappingType getMappedType()
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
getJavaTypeDescriptor
default JavaType<T> getJavaTypeDescriptor()
Description copied from interface:JdbcMapping
The descriptor for the Java type represented by this expressible type- Specified by:
getJavaTypeDescriptor
in interfaceJdbcMapping
-
getExpressibleJavaType
default JavaType<T> getExpressibleJavaType()
Description copied from interface:SqmExpressible
The Java type descriptor for this expressible- Specified by:
getExpressibleJavaType
in interfaceJavaTypedExpressible<T>
- Specified by:
getExpressibleJavaType
in interfaceSqmExpressible<T>
- Specified by:
getExpressibleJavaType
in interfaceValueMapping
-
forEachJdbcType
default int forEachJdbcType(IndexedConsumer<JdbcMapping> action)
Description copied from interface:Bindable
Visit each of JdbcMapping- Specified by:
forEachJdbcType
in interfaceBindable
- Specified by:
forEachJdbcType
in interfaceJdbcMapping
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
getJdbcMapping
default JdbcMapping getJdbcMapping()
Description copied from interface:SqlExpressible
Anything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMapping
in interfaceBasicValuedMapping
- Specified by:
getJdbcMapping
in interfaceSqlExpressible
-
getJdbcTypeCount
default int getJdbcTypeCount()
Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBasicValuedMapping
- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceJdbcMapping
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
-
getJdbcMapping
default JdbcMapping getJdbcMapping(int index)
- Specified by:
getJdbcMapping
in interfaceBasicValuedMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMapping
- Specified by:
getJdbcMapping
in interfaceJdbcMappingContainer
- Specified by:
getJdbcMapping
in interfaceSqlExpressible
-
getSingleJdbcMapping
default JdbcMapping getSingleJdbcMapping()
- Specified by:
getSingleJdbcMapping
in interfaceBasicValuedMapping
- Specified by:
getSingleJdbcMapping
in interfaceJdbcMapping
- Specified by:
getSingleJdbcMapping
in interfaceJdbcMappingContainer
-
getMappedJavaType
default JavaType<T> getMappedJavaType()
Description copied from interface:MappingType
The descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaType
in interfaceJdbcMapping
- Specified by:
getMappedJavaType
in interfaceMappingType
-
getValueConverter
@Incubating default BasicValueConverter<T,?> getValueConverter()
Description copied from interface:JdbcMapping
Returns the converter that this basic type uses for transforming from the domain type, to the relational type, ornull
if there is no conversion.- Specified by:
getValueConverter
in interfaceJdbcMapping
-
getJdbcValueExtractor
default ValueExtractor<T> getJdbcValueExtractor()
Description copied from interface:JdbcMapping
The strategy for extracting values of this expressible type from JDBC ResultSets, CallableStatements, etc- Specified by:
getJdbcValueExtractor
in interfaceJdbcMapping
-
getJdbcValueBinder
default ValueBinder<T> getJdbcValueBinder()
Description copied from interface:JdbcMapping
The strategy for binding values of this expressible type to JDBCPreparedStatement
s andCallableStatement
s.- Specified by:
getJdbcValueBinder
in interfaceJdbcMapping
-
getJdbcLiteralFormatter
default JdbcLiteralFormatter<T> getJdbcLiteralFormatter()
Description copied from interface:JdbcMapping
The strategy for formatting values of this expressible type to a SQL literal.- Specified by:
getJdbcLiteralFormatter
in interfaceJdbcMapping
-
forEachJdbcType
default int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceJdbcMapping
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
disassemble
default Object disassemble(Object value, SharedSessionContractImplementor session)
Description copied from interface:Bindable
Breaks down a value ofJ
into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.Generally speaking, this is the form in which entity state is kept relative to a Session via
EntityEntry
.@Entity class Person { @Id Integer id; @Embedded Name name; int age; } @Embeddable class Name { String familiarName; String familyName; }
At the top level, we would want to disassemble a
Person
value, so we'd ask theBindable
for thePerson
entity to disassemble. Given aPerson
value:Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )
this disassemble would result in a multidimensional array:
[ ["Steve", "Ebersole"], 28 ]
Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.
- Specified by:
disassemble
in interfaceBasicValuedMapping
- Specified by:
disassemble
in interfaceBindable
- See Also:
EntityEntry
-
forEachDisassembledJdbcValue
default <X,Y> int forEachDisassembledJdbcValue(Object value, int offset, X x, Y y, Bindable.JdbcValuesBiConsumer<X,Y> valuesConsumer, SharedSessionContractImplementor session)
Description copied from interface:Bindable
LikeBindable.forEachDisassembledJdbcValue(Object, Object, Object, JdbcValuesBiConsumer, SharedSessionContractImplementor)
, but additionally receives an offset by which the selectionIndex is incremented when callingBindable.JdbcValuesBiConsumer.consume(int, Object, Object, Object, JdbcMapping)
.- Specified by:
forEachDisassembledJdbcValue
in interfaceBindable
-
getCheckCondition
@Incubating default String getCheckCondition(String columnName, Dialect dialect)
The check constraint that should be added to the column definition in generated DDL.- Parameters:
columnName
- the name of the columndialect
- the SQLDialect
- Returns:
- a check constraint condition or null
- Since:
- 6.2
-
compare
default int compare(Object x, Object y, SessionFactoryImplementor sessionFactory)
-
-