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,SqmBindableType<T>,SqmDomainType<T>,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,SerializableType,StandardBasicTypeTemplate
public interfaceBasicType<T>extendsType,BasicDomainType<T>,MappingType,BasicValuedMapping,JdbcMapping,SqmDomainType<T>
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.PersistenceTypeMethod Summary
Modifier and TypeMethodDescriptiondefault intcompare(Object x,Object y,SessionFactoryImplementor sessionFactory) defaultObjectdisassemble(Object value,SharedSessionContractImplementor session) Breaks down a value ofJinto its simple pieces.default <X,Y> int forEachDisassembledJdbcValue(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 intforEachJdbcType(int offset,IndexedConsumer<JdbcMapping> action) Visit each JdbcMapping starting from the given offsetdefault intforEachJdbcType(IndexedConsumer<JdbcMapping> action) Visit each of JdbcMappingdefaultStringgetCheckCondition(String columnName,Dialect dialect) The check constraint that should be added to the column definition in generated DDL.TheJavaTyperepresenting this domain type.The Java class which represents by this domain type.The descriptor for the Java type represented by this expressible typedefaultJdbcLiteralFormatter<T>The strategy for formatting values of this expressible type to a SQL literal.defaultJdbcMappingAnything that is expressible at the SQL AST level would be of basic type.defaultJdbcMappinggetJdbcMapping(int index) default intThe number of JDBC mappingsdefaultValueBinder<T>The strategy for binding values of this expressible type to JDBCPreparedStatements andCallableStatements.defaultValueExtractor<T>The strategy for extracting values of this expressible type from JDBC ResultSets, CallableStatements, etcThedescriptor descriptor for the mapped Java typedefaultMappingTypeDescriptor for the type of this mappingString[]Get the names under which this type should be registered in the type registry.defaultJdbcMappingdefaultSqmDomainType<T>defaultBasicValueConverter<T,?> Returns the converter that this basic type uses for transforming from the domain type, to the relational type, ornullif there is no conversion.Methods inherited from interface org.hibernate.metamodel.model.domain.BasicDomainType
getPersistenceTypeMethods inherited from interface org.hibernate.metamodel.mapping.BasicValuedMapping
addToCacheKeyMethods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue,forEachDisassembledJdbcValue,forEachDisassembledJdbcValue,forEachJdbcValue,forEachJdbcValue,forEachJdbcValue,forEachJdbcValueMethods inherited from interface org.hibernate.metamodel.mapping.JdbcMapping
convertToDomainValue,convertToRelationalValue,getCastType,getJdbcJavaType,getJdbcTypeMethods inherited from interface org.hibernate.type.OutputableType
canDoExtraction,extract,extract,getJdbcTypeMethods inherited from interface org.hibernate.query.sqm.SqmBindableType
resolveExpressibleMethods inherited from interface org.hibernate.query.sqm.tree.domain.SqmDomainType
getTupleLength,getTypeNameMethods inherited from interface org.hibernate.query.sqm.SqmExpressible
getRelationalJavaTypeMethods 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,toLoggableStringMethods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
treatAs
Method Details
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.
getJavaType
Description copied from interface:DomainTypeThe Java class which represents by this domain type.- Specified by:
getJavaTypein interfaceBasicDomainType<T>- Specified by:
getJavaTypein interfaceDomainType<T>- Specified by:
getJavaTypein interfaceSimpleDomainType<T>- Specified by:
getJavaTypein interfaceType<T>- See Also:
getMappedType
Description copied from interface:ValueMappingDescriptor for the type of this mapping- Specified by:
getMappedTypein interfaceValueMapping
getJavaTypeDescriptor
Description copied from interface:JdbcMappingThe descriptor for the Java type represented by this expressible type- Specified by:
getJavaTypeDescriptorin interfaceJdbcMapping
getExpressibleJavaType
Description copied from interface:DomainTypeTheJavaTyperepresenting this domain type.- Specified by:
getExpressibleJavaTypein interfaceDomainType<T>- Specified by:
getExpressibleJavaTypein interfaceJavaTypedExpressible<T>- Specified by:
getExpressibleJavaTypein interfaceSqmExpressible<T>- Specified by:
getExpressibleJavaTypein interfaceValueMapping
forEachJdbcType
Description copied from interface:BindableVisit each of JdbcMapping- Specified by:
forEachJdbcTypein interfaceBindable- Specified by:
forEachJdbcTypein interfaceJdbcMapping- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
getJdbcMapping
Description copied from interface:SqlExpressibleAnything that is expressible at the SQL AST level would be of basic type.- Specified by:
getJdbcMappingin interfaceBasicValuedMapping- Specified by:
getJdbcMappingin interfaceSqlExpressible
getJdbcTypeCount
default int getJdbcTypeCount()Description copied from interface:BindableThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceBasicValuedMapping- Specified by:
getJdbcTypeCountin interfaceBindable- Specified by:
getJdbcTypeCountin interfaceJdbcMapping- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer
getJdbcMapping
- Specified by:
getJdbcMappingin interfaceBasicValuedMapping- Specified by:
getJdbcMappingin interfaceJdbcMapping- Specified by:
getJdbcMappingin interfaceJdbcMappingContainer- Specified by:
getJdbcMappingin interfaceSqlExpressible
getSingleJdbcMapping
- Specified by:
getSingleJdbcMappingin interfaceBasicValuedMapping- Specified by:
getSingleJdbcMappingin interfaceJdbcMapping- Specified by:
getSingleJdbcMappingin interfaceJdbcMappingContainer
getMappedJavaType
Description copied from interface:MappingTypeThedescriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceJdbcMapping- Specified by:
getMappedJavaTypein interfaceMappingType
getValueConverter
Description copied from interface:JdbcMappingReturns the converter that this basic type uses for transforming from the domain type, to the relational type, ornullif there is no conversion.- Specified by:
getValueConverterin interfaceJdbcMapping
getJdbcValueExtractor
Description copied from interface:JdbcMappingThe strategy for extracting values of this expressible type from JDBC ResultSets, CallableStatements, etc- Specified by:
getJdbcValueExtractorin interfaceJdbcMapping
getJdbcValueBinder
Description copied from interface:JdbcMappingThe strategy for binding values of this expressible type to JDBCPreparedStatements andCallableStatements.- Specified by:
getJdbcValueBinderin interfaceJdbcMapping
getJdbcLiteralFormatter
Description copied from interface:JdbcMappingThe strategy for formatting values of this expressible type to a SQL literal.- Specified by:
getJdbcLiteralFormatterin interfaceJdbcMapping
forEachJdbcType
Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceJdbcMapping- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
getSqmType
- Specified by:
getSqmTypein interfaceSqmExpressible<T>
disassemble
Description copied from interface:BindableBreaks down a value ofJinto 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
Personvalue, so we'd ask theBindablefor thePersonentity to disassemble. Given aPersonvalue: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:
disassemblein interfaceBasicValuedMapping- Specified by:
disassemblein interfaceBindable- See Also:
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:BindableLikeBindable.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:
forEachDisassembledJdbcValuein interfaceBindable
getCheckCondition
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