Package org.hibernate.mapping
Class BasicValue
- java.lang.Object
-
- org.hibernate.mapping.SimpleValue
-
- org.hibernate.mapping.BasicValue
-
- All Implemented Interfaces:
Serializable,KeyValue,Resolvable,Value,JdbcTypeIndicators
- Direct Known Subclasses:
DependantBasicValue
public class BasicValue extends SimpleValue implements JdbcTypeIndicators, Resolvable
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBasicValue.Resolution<J>Resolved form ofBasicValueas part of interpreting the boot-time model into the run-time model
-
Field Summary
-
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGY
-
Fields inherited from interface org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators
NO_COLUMN_LENGTH, NO_COLUMN_PRECISION, NO_COLUMN_SCALE
-
-
Constructor Summary
Constructors Constructor Description BasicValue(MetadataBuildingContext buildingContext)BasicValue(MetadataBuildingContext buildingContext, Table table)BasicValue(BasicValue original)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectaccept(ValueVisitor visitor)voidaddColumn(Column incomingColumn)voidaddColumn(Column incomingColumn, boolean isInsertable, boolean isUpdatable)voidaddFormula(Formula formula)protected BasicValue.Resolution<?>buildResolution()BasicValuecopy()voidcopyTypeFrom(SimpleValue sourceValue)SelectablePathcreateSelectablePath(String selectableName)AggregateColumngetAggregateColumn()SelectablegetColumn()longgetColumnLength()Useful for resolutions based on column length.intgetColumnPrecision()Useful for resolutions based on column precision.intgetColumnScale()Useful for resolutions based on column scale.TimeZoneStorageStrategygetDefaultTimeZoneStorageStrategy()The defaultTimeZoneStorageStrategy.DialectgetDialect()EnumTypegetEnumeratedType()For enum mappings, what style of storage was requested (name vs.EnumTypegetEnumerationStyle()intgetPreferredSqlTypeCodeForArray()When mapping a basic array or collection type to the database what is the preferred SQL type code to use?intgetPreferredSqlTypeCodeForBoolean()When mapping a boolean type to the database what is the preferred SQL type code to use?intgetPreferredSqlTypeCodeForDuration()When mapping a duration type to the database what is the preferred SQL type code to use?intgetPreferredSqlTypeCodeForInstant()When mapping an instant type to the database what is the preferred SQL type code to use?intgetPreferredSqlTypeCodeForUuid()When mapping an uuid type to the database what is the preferred SQL type code to use?BasicValue.Resolution<?>getResolution()TypegetResolvedJavaType()TemporalTypegetTemporalPrecision()For temporal type mappings, what precision was requested?TimeZoneStorageTypegetTimeZoneStorageType()TypegetType()booleanisDisallowedWrapperArray()BasicValue.Resolution<?>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)<T extends UserType<?>>
voidsetExplicitCustomType(Class<T> explicitCustomType)voidsetExplicitJavaTypeAccess(Function<TypeConfiguration,BasicJavaType> explicitJavaTypeAccess)voidsetExplicitJdbcTypeAccess(Function<TypeConfiguration,JdbcType> jdbcTypeAccess)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, createGenerator, createParameterImpl, createUniqueKey, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumnIterator, getColumns, getColumnSpan, getColumnUpdateability, getConstraintColumnIterator, getCustomIdGeneratorCreator, getFetchMode, getForeignKeyDefinition, getForeignKeyName, getIdentifierGenerator, getIdentifierGeneratorParameters, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getOnDeleteAction, getSelectables, getServiceRegistry, getTable, getTypeConfiguration, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isColumnInsertable, isColumnUpdateable, isConstrained, isForeignKeyEnabled, isIdentityColumn, isLob, isNationalized, isNullable, isPartitionKey, isSame, isSame, isSame, isSimpleValue, isTypeSpecified, isUpdateable, isValid, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeParameterImpl, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setCascadeDeleteEnabled, setCustomIdGeneratorCreator, setForeignKeyDefinition, setForeignKeyName, setIdentifierGeneratorParameters, setIdentifierGeneratorProperties, setIdentifierGeneratorProperties, setIdentifierGeneratorStrategy, setNullValue, setOnDeleteAction, setPartitionKey, setTable, setTypeParameters, setTypeParameters, sortColumns, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.type.descriptor.jdbc.JdbcTypeIndicators
getDefaultZonedTimeSqlType, getDefaultZonedTimestampSqlType, getJdbcType, getTypeConfiguration, isLob, isNationalized
-
Methods inherited from interface org.hibernate.mapping.KeyValue
createIdentifierGenerator, createIdentifierGenerator
-
Methods inherited from interface org.hibernate.mapping.Value
getConstraintColumns, getSelectableType, getVirtualSelectables
-
-
-
-
Constructor Detail
-
BasicValue
public BasicValue(MetadataBuildingContext buildingContext)
-
BasicValue
public BasicValue(MetadataBuildingContext buildingContext, Table table)
-
BasicValue
public BasicValue(BasicValue original)
-
-
Method Detail
-
copy
public BasicValue copy()
-
setTypeUsingReflection
public void setTypeUsingReflection(String className, String propertyName) throws MappingException
- Specified by:
setTypeUsingReflectionin interfaceValue- Overrides:
setTypeUsingReflectionin classSimpleValue- Throws:
MappingException
-
setEnumerationStyle
public void setEnumerationStyle(EnumType enumerationStyle)
-
getEnumerationStyle
public EnumType getEnumerationStyle()
-
getTimeZoneStorageType
public TimeZoneStorageType getTimeZoneStorageType()
-
setTimeZoneStorageType
public void setTimeZoneStorageType(TimeZoneStorageType timeZoneStorageType)
-
setJpaAttributeConverterDescriptor
public void setJpaAttributeConverterDescriptor(ConverterDescriptor descriptor)
- Overrides:
setJpaAttributeConverterDescriptorin classSimpleValue
-
setExplicitJavaTypeAccess
public void setExplicitJavaTypeAccess(Function<TypeConfiguration,BasicJavaType> explicitJavaTypeAccess)
-
setExplicitJdbcTypeAccess
public void setExplicitJdbcTypeAccess(Function<TypeConfiguration,JdbcType> jdbcTypeAccess)
-
setExplicitMutabilityPlanAccess
public void setExplicitMutabilityPlanAccess(Function<TypeConfiguration,MutabilityPlan> explicitMutabilityPlanAccess)
-
setImplicitJavaTypeAccess
public void setImplicitJavaTypeAccess(Function<TypeConfiguration,Type> implicitJavaTypeAccess)
-
getColumn
public Selectable getColumn()
-
getResolvedJavaType
public Type 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
public void addColumn(Column incomingColumn)
- Overrides:
addColumnin classSimpleValue
-
copyTypeFrom
public void copyTypeFrom(SimpleValue sourceValue)
- Overrides:
copyTypeFromin classSimpleValue
-
addColumn
public void addColumn(Column incomingColumn, boolean isInsertable, boolean isUpdatable)
- Overrides:
addColumnin classSimpleValue
-
addFormula
public void addFormula(Formula formula)
- Overrides:
addFormulain classSimpleValue
-
getType
public Type getType() throws MappingException
- Specified by:
getTypein interfaceValue- Throws:
MappingException
-
getResolution
public BasicValue.Resolution<?> getResolution()
-
resolve
public boolean resolve(MetadataBuildingContext buildingContext)
- Specified by:
resolvein interfaceResolvable
-
resolve
public BasicValue.Resolution<?> resolve()
- Specified by:
resolvein interfaceResolvable
-
getDialect
public Dialect getDialect()
- Specified by:
getDialectin interfaceJdbcTypeIndicators
-
getAggregateColumn
public AggregateColumn getAggregateColumn()
-
setAggregateColumn
public void setAggregateColumn(AggregateColumn aggregateColumn)
-
createSelectablePath
public SelectablePath createSelectablePath(String selectableName)
-
buildResolution
protected BasicValue.Resolution<?> buildResolution()
-
getEnumeratedType
public EnumType 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:
AvailableSettings.PREFERRED_BOOLEAN_JDBC_TYPE,Dialect.getPreferredSqlTypeCodeForBoolean()
-
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:
AvailableSettings.PREFERRED_DURATION_JDBC_TYPE
-
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:
AvailableSettings.PREFERRED_UUID_JDBC_TYPE
-
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:
AvailableSettings.PREFERRED_INSTANT_JDBC_TYPE
-
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:
Dialect.getPreferredSqlTypeCodeForArray()
-
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
public TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
Description copied from interface:JdbcTypeIndicatorsThe defaultTimeZoneStorageStrategy.- Specified by:
getDefaultTimeZoneStorageStrategyin interfaceJdbcTypeIndicators- See Also:
AvailableSettings.TIMEZONE_DEFAULT_STORAGE,Dialect.getTimeZoneSupport()
-
timeZoneStorageStrategy
public static TimeZoneStorageStrategy timeZoneStorageStrategy(TimeZoneStorageType timeZoneStorageType, MetadataBuildingContext buildingContext)
-
setExplicitTypeParams
public void setExplicitTypeParams(Map<String,String> explicitLocalTypeParams)
-
setExplicitTypeName
public void setExplicitTypeName(String typeName)
-
setTypeName
public void setTypeName(String typeName)
- Overrides:
setTypeNamein classSimpleValue
-
setExplicitCustomType
public <T extends UserType<?>> void setExplicitCustomType(Class<T> explicitCustomType)
-
setTemporalPrecision
public void setTemporalPrecision(TemporalType temporalPrecision)
-
getTemporalPrecision
public TemporalType getTemporalPrecision()
Description copied from interface:JdbcTypeIndicatorsFor temporal type mappings, what precision was requested?- Specified by:
getTemporalPrecisionin interfaceJdbcTypeIndicators
-
accept
public Object accept(ValueVisitor visitor)
- Specified by:
acceptin interfaceValue- Overrides:
acceptin classSimpleValue
-
isDisallowedWrapperArray
public boolean isDisallowedWrapperArray()
-
-