Package org.hibernate.mapping
Class BasicValue
java.lang.Object
org.hibernate.mapping.SimpleValue
org.hibernate.mapping.BasicValue
- All Implemented Interfaces:
Serializable,JpaAttributeConverterCreationContext,KeyValue,Resolvable,Value,JdbcTypeIndicators
- Direct Known Subclasses:
DependantBasicValue
public class BasicValue
extends SimpleValue
implements JdbcTypeIndicators, Resolvable, JpaAttributeConverterCreationContext
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceResolved form ofBasicValueas part of interpreting the boot-time model into the run-time modelNested classes/interfaces inherited from interface org.hibernate.mapping.KeyValue
KeyValue.NullValueSemantic -
Field Summary
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGYFields inherited from interface org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators
NO_COLUMN_LENGTH, NO_COLUMN_PRECISION, NO_COLUMN_SCALE -
Constructor Summary
ConstructorsConstructorDescriptionBasicValue(MetadataBuildingContext buildingContext) BasicValue(MetadataBuildingContext buildingContext, Table table) BasicValue(BasicValue original) -
Method Summary
Modifier and TypeMethodDescriptionaccept(ValueVisitor visitor) voidvoidvoidaddFormula(Formula formula) protected BasicValue.Resolution<?> copy()voidcopyTypeFrom(SimpleValue sourceValue) createSelectablePath(String selectableName) longUseful for resolutions based on column length.intUseful for resolutions based on column precision.intUseful for resolutions based on column scale.The defaultTimeZoneStorageStrategy.For enum mappings, what style of storage was requested (name vs.Used (for now) only to choose a containerJdbcTypefor SQL arrays.intWhen mapping a basic array or collection type to the database what is the preferred SQL type code to use?intWhen mapping a boolean type to the database what is the preferred SQL type code to use?intWhen mapping a duration type to the database what is the preferred SQL type code to use?intWhen mapping an instant type to the database what is the preferred SQL type code to use?intWhen mapping an uuid type to the database what is the preferred SQL type code to use?For temporal type mappings, what precision was requested?getType()impliedJavaType(TypeConfiguration typeConfiguration) booleanbooleanbooleanbooleanvoidmakeSoftDelete(SoftDeleteType strategy) resolve()booleanresolve(MetadataBuildingContext buildingContext) intresolveJdbcTypeCode(int jdbcTypeCode) Resolves the given type code to a possibly different type code, based on context.voidsetAggregateColumn(AggregateColumn aggregateColumn) voidsetEnumerationStyle(EnumType enumerationStyle) voidsetExplicitCustomType(Class<? extends UserType<?>> explicitCustomType) voidsetExplicitJavaTypeAccess(Function<TypeConfiguration, BasicJavaType<?>> explicitJavaTypeAccess) voidsetExplicitJdbcTypeAccess(Function<TypeConfiguration, JdbcType> jdbcTypeAccess) voidsetExplicitJdbcTypeCode(Integer jdbcTypeCode) voidsetExplicitMutabilityPlanAccess(Function<TypeConfiguration, MutabilityPlan<?>> explicitMutabilityPlanAccess) voidsetExplicitTypeName(String typeName) voidsetExplicitTypeParams(Map<String, String> explicitLocalTypeParams) voidsetImplicitJavaTypeAccess(Function<TypeConfiguration, Type> implicitJavaTypeAccess) voidsetJpaAttributeConverterDescriptor(ConverterDescriptor<?, ?> descriptor) voidsetTemporalPrecision(TemporalType temporalPrecision) voidsetTimeZoneStorageType(TimeZoneStorageType timeZoneStorageType) voidsetTypeName(String typeName) voidsetTypeUsingReflection(String className, String propertyName) static TimeZoneStorageStrategytimeZoneStorageStrategy(TimeZoneStorageType timeZoneStorageType, MetadataBuildingContext buildingContext) Methods inherited from class org.hibernate.mapping.SimpleValue
createForeignKey, createForeignKey, createForeignKeyOfEntity, createForeignKeyOfEntity, createGenerator, createGenerator, createParameterType, createUniqueKey, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumns, getColumnSpan, getColumnUpdateability, getCustomIdGeneratorCreator, getFetchMode, getForeignKeyDefinition, getForeignKeyName, getForeignKeyOptions, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getNullValueSemantic, getOnDeleteAction, getSelectables, getServiceRegistry, getTable, getTypeConfiguration, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isColumnInsertable, isColumnUpdateable, isConstrained, isForeignKeyEnabled, isLob, isNationalized, isNullable, isPartitionKey, isSame, isSame, isSame, isSimpleValue, isTypeSpecified, isUpdateable, isValid, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setColumnToIdentity, setCustomIdGeneratorCreator, setForeignKeyDefinition, setForeignKeyName, setForeignKeyOptions, setNullValue, setNullValueSemantic, setNullValueUndefined, setOnDeleteAction, setPartitionKey, setTable, setTypeParameters, setTypeParameters, sortColumns, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators
getDefaultZonedTimeSqlType, getDefaultZonedTimestampSqlType, getJdbcType, getPreferredSqlTypeCodeForArray, getTypeConfiguration, isLob, isNationalized, isXmlFormatMapperLegacyFormatEnabled, preferJdbcDatetimeTypesMethods inherited from interface org.hibernate.boot.model.convert.spi.JpaAttributeConverterCreationContext
getJavaTypeRegistry, getTypeConfigurationMethods inherited from interface org.hibernate.mapping.Value
checkColumnDuplication, getConstraintColumns, getSelectableType, getVirtualSelectables
-
Constructor Details
-
BasicValue
-
BasicValue
-
BasicValue
-
-
Method Details
-
copy
-
isSoftDelete
public boolean isSoftDelete() -
getSoftDeleteStrategy
-
makeSoftDelete
-
setTypeUsingReflection
- Specified by:
setTypeUsingReflectionin interfaceValue- Overrides:
setTypeUsingReflectionin classSimpleValue- Throws:
MappingException
-
setEnumerationStyle
-
getEnumerationStyle
-
getTimeZoneStorageType
-
setTimeZoneStorageType
-
setJpaAttributeConverterDescriptor
- Overrides:
setJpaAttributeConverterDescriptorin classSimpleValue
-
setExplicitJavaTypeAccess
public void setExplicitJavaTypeAccess(Function<TypeConfiguration, BasicJavaType<?>> explicitJavaTypeAccess) -
setExplicitJdbcTypeAccess
-
setExplicitMutabilityPlanAccess
public void setExplicitMutabilityPlanAccess(Function<TypeConfiguration, MutabilityPlan<?>> explicitMutabilityPlanAccess) -
setImplicitJavaTypeAccess
-
getColumn
-
getResolvedJavaType
-
getColumnLength
public long getColumnLength()Description copied from interface:JdbcTypeIndicatorsUseful for resolutions based on column length.E.g. for choosing between a
VARCHAR(String) andCHAR(1)(Character/char).- Specified by:
getColumnLengthin interfaceJdbcTypeIndicators
-
getColumnPrecision
public int getColumnPrecision()Description copied from interface:JdbcTypeIndicatorsUseful for resolutions based on column precision.- Specified by:
getColumnPrecisionin interfaceJdbcTypeIndicators
-
getColumnScale
public int getColumnScale()Description copied from interface:JdbcTypeIndicatorsUseful for resolutions based on column scale.E.g. for choosing between a
NUMERICandINTERVAL SECOND.- Specified by:
getColumnScalein interfaceJdbcTypeIndicators
-
addColumn
- Overrides:
addColumnin classSimpleValue
-
copyTypeFrom
- Overrides:
copyTypeFromin classSimpleValue
-
addColumn
- Overrides:
addColumnin classSimpleValue
-
addFormula
- Overrides:
addFormulain classSimpleValue
-
getType
- Specified by:
getTypein interfaceValue- Throws:
MappingException
-
getResolution
-
resolve
- Specified by:
resolvein interfaceResolvable
-
resolve
- Specified by:
resolvein interfaceResolvable
-
getExtraCreateTableInfo
- Specified by:
getExtraCreateTableInfoin interfaceValue
-
getDialect
- Specified by:
getDialectin interfaceJdbcTypeIndicators
-
getAggregateColumn
-
setAggregateColumn
-
createSelectablePath
-
buildResolution
-
getManagedBeanRegistry
- Specified by:
getManagedBeanRegistryin interfaceJpaAttributeConverterCreationContext
-
impliedJavaType
-
getEnumeratedType
Description copied from interface:JdbcTypeIndicatorsFor enum mappings, what style of storage was requested (name vs. ordinal)?- Specified by:
getEnumeratedTypein interfaceJdbcTypeIndicators- Returns:
- The enum type.
-
getPreferredSqlTypeCodeForBoolean
public int getPreferredSqlTypeCodeForBoolean()Description copied from interface:JdbcTypeIndicatorsWhen mapping a boolean type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForBooleanin interfaceJdbcTypeIndicators- See Also:
-
getPreferredSqlTypeCodeForDuration
public int getPreferredSqlTypeCodeForDuration()Description copied from interface:JdbcTypeIndicatorsWhen mapping a duration type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForDurationin interfaceJdbcTypeIndicators- See Also:
-
getPreferredSqlTypeCodeForUuid
public int getPreferredSqlTypeCodeForUuid()Description copied from interface:JdbcTypeIndicatorsWhen mapping an uuid type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForUuidin interfaceJdbcTypeIndicators- See Also:
-
getPreferredSqlTypeCodeForInstant
public int getPreferredSqlTypeCodeForInstant()Description copied from interface:JdbcTypeIndicatorsWhen mapping an instant type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForInstantin interfaceJdbcTypeIndicators- See Also:
-
getPreferredSqlTypeCodeForArray
public int getPreferredSqlTypeCodeForArray()Description copied from interface:JdbcTypeIndicatorsWhen mapping a basic array or collection type to the database what is the preferred SQL type code to use?Returns a key into the
JdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForArrayin interfaceJdbcTypeIndicators- See Also:
-
resolveJdbcTypeCode
public int resolveJdbcTypeCode(int jdbcTypeCode) Description copied from interface:JdbcTypeIndicatorsResolves the given type code to a possibly different type code, based on context.A database might not support a certain type code in certain scenarios like within a UDT and has to resolve to a different type code in such a scenario.
- Specified by:
resolveJdbcTypeCodein interfaceJdbcTypeIndicators- Parameters:
jdbcTypeCode- a type code fromSqlTypes- Returns:
- The jdbc type code to use
-
getDefaultTimeZoneStorageStrategy
Description copied from interface:JdbcTypeIndicatorsThe defaultTimeZoneStorageStrategy.- Specified by:
getDefaultTimeZoneStorageStrategyin interfaceJdbcTypeIndicators- See Also:
-
timeZoneStorageStrategy
@Internal public static TimeZoneStorageStrategy timeZoneStorageStrategy(TimeZoneStorageType timeZoneStorageType, MetadataBuildingContext buildingContext) -
setExplicitTypeParams
-
setExplicitTypeName
-
setTypeName
- Overrides:
setTypeNamein classSimpleValue
-
setExplicitCustomType
-
setTemporalPrecision
-
getTemporalPrecision
Description copied from interface:JdbcTypeIndicatorsFor temporal type mappings, what precision was requested?- Specified by:
getTemporalPrecisionin interfaceJdbcTypeIndicators
-
isPreferJavaTimeJdbcTypesEnabled
public boolean isPreferJavaTimeJdbcTypesEnabled()- Specified by:
isPreferJavaTimeJdbcTypesEnabledin interfaceJdbcTypeIndicators- See Also:
-
isPreferNativeEnumTypesEnabled
public boolean isPreferNativeEnumTypesEnabled()- Specified by:
isPreferNativeEnumTypesEnabledin interfaceJdbcTypeIndicators- See Also:
-
accept
- Specified by:
acceptin interfaceValue- Overrides:
acceptin classSimpleValue
-
isDisallowedWrapperArray
-
setExplicitJdbcTypeCode
-
getExplicitJdbcTypeCode
Description copied from interface:JdbcTypeIndicatorsUsed (for now) only to choose a containerJdbcTypefor SQL arrays.- Specified by:
getExplicitJdbcTypeCodein interfaceJdbcTypeIndicators
-