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 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)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()EnumTypegetEnumeratedType()For enum mappings, what style of storage was requested (name vs.EnumTypegetEnumerationStyle()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()TypeConfigurationgetTypeConfiguration()Provides access to the TypeConfiguration for access to various type-system registries.BasicValue.Resolution<?>resolve()booleanresolve(MetadataBuildingContext buildingContext)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<Object,Object> explicitLocalTypeParams)voidsetImplicitJavaTypeAccess(Function<TypeConfiguration,Type> implicitJavaTypeAccess)voidsetJpaAttributeConverterDescriptor(ConverterDescriptor descriptor)voidsetTemporalPrecision(TemporalType temporalPrecision)voidsetTimeZoneStorageType(TimeZoneStorageType timeZoneStorageType)voidsetTypeName(String typeName)voidsetTypeUsingReflection(String className, String propertyName)-
Methods inherited from class org.hibernate.mapping.SimpleValue
createForeignKey, createForeignKeyOfEntity, createIdentifierGenerator, createIdentifierGenerator, createParameterImpl, createUniqueKey, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumnIterator, getColumns, getColumnSpan, getColumnUpdateability, getConstraintColumnIterator, getCustomIdGeneratorCreator, getFetchMode, getForeignKeyDefinition, getForeignKeyName, getIdentifierGenerator, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getSelectables, getServiceRegistry, getTable, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isConstrained, isForeignKeyEnabled, isIdentityColumn, isLob, isNationalized, isNullable, isSame, isSame, isSame, isSimpleValue, isTypeSpecified, isUpdateable, isValid, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeParameterImpl, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setCascadeDeleteEnabled, setCustomIdGeneratorCreator, setForeignKeyDefinition, setForeignKeyName, setIdentifierGeneratorProperties, setIdentifierGeneratorProperties, setIdentifierGeneratorStrategy, setNullValue, 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
isLob, isNationalized
-
Methods inherited from interface org.hibernate.mapping.Value
getConstraintColumns, 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. choosing between a VARCHAR (String) and a CHAR(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. choosing between a NUMERIC or INTERVAL- 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
-
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? Specifically names the key into theJdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForBooleanin interfaceJdbcTypeIndicators
-
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? Specifically names the key into theJdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForDurationin interfaceJdbcTypeIndicators
-
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? Specifically names the key into theJdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForUuidin interfaceJdbcTypeIndicators
-
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? Specifically names the key into theJdbcTypeRegistry.- Specified by:
getPreferredSqlTypeCodeForInstantin interfaceJdbcTypeIndicators
-
getDefaultTimeZoneStorageStrategy
public TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
- Specified by:
getDefaultTimeZoneStorageStrategyin interfaceJdbcTypeIndicators
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:JdbcTypeIndicatorsProvides access to the TypeConfiguration for access to various type-system registries.- Specified by:
getTypeConfigurationin interfaceJdbcTypeIndicators
-
setExplicitTypeParams
public void setExplicitTypeParams(Map<Object,Object> 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
-
-