Package org.hibernate.mapping
Class BasicValue
- java.lang.Object
-
- org.hibernate.mapping.SimpleValue
-
- org.hibernate.mapping.BasicValue
-
- All Implemented Interfaces:
Serializable,KeyValue,Resolvable,Value,JdbcTypeDescriptorIndicators
- Direct Known Subclasses:
DependantBasicValue
public class BasicValue extends SimpleValue implements JdbcTypeDescriptorIndicators, 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.JdbcTypeDescriptorIndicators
NO_COLUMN_LENGTH, NO_COLUMN_PRECISION, NO_COLUMN_SCALE
-
-
Constructor Summary
Constructors Constructor Description BasicValue(MetadataBuildingContext buildingContext)BasicValue(MetadataBuildingContext buildingContext, Table table)
-
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()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?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 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, createParameterImpl, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumnIterator, getColumnSpan, getColumnUpdateability, getConstraintColumns, getFetchMode, getForeignKeyDefinition, getForeignKeyName, getIdentifierGenerator, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getSelectables, getServiceRegistry, getTable, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isConstrained, isIdentityColumn, isLob, isNationalized, isNullable, isSame, isSame, isSame, isSimpleValue, isTypeSpecified, isUpdateable, isValid, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeParameterImpl, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setCascadeDeleteEnabled, 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.JdbcTypeDescriptorIndicators
isLob, isNationalized
-
-
-
-
Constructor Detail
-
BasicValue
public BasicValue(MetadataBuildingContext buildingContext)
-
BasicValue
public BasicValue(MetadataBuildingContext buildingContext, Table table)
-
-
Method Detail
-
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:JdbcTypeDescriptorIndicatorsUseful for resolutions based on column length. E.g. choosing between a VARCHAR (String) and a CHAR(1) (Character/char)- Specified by:
getColumnLengthin interfaceJdbcTypeDescriptorIndicators
-
getColumnPrecision
public int getColumnPrecision()
Description copied from interface:JdbcTypeDescriptorIndicatorsUseful for resolutions based on column precision.- Specified by:
getColumnPrecisionin interfaceJdbcTypeDescriptorIndicators
-
getColumnScale
public int getColumnScale()
Description copied from interface:JdbcTypeDescriptorIndicatorsUseful for resolutions based on column scale. E.g. choosing between a NUMERIC or INTERVAL- Specified by:
getColumnScalein interfaceJdbcTypeDescriptorIndicators
-
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:JdbcTypeDescriptorIndicatorsFor enum mappings, what style of storage was requested (name vs. ordinal)?- Specified by:
getEnumeratedTypein interfaceJdbcTypeDescriptorIndicators- Returns:
- The enum type.
-
getPreferredSqlTypeCodeForBoolean
public int getPreferredSqlTypeCodeForBoolean()
Description copied from interface:JdbcTypeDescriptorIndicatorsWhen 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 interfaceJdbcTypeDescriptorIndicators
-
getDefaultTimeZoneStorageStrategy
public TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
- Specified by:
getDefaultTimeZoneStorageStrategyin interfaceJdbcTypeDescriptorIndicators
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:JdbcTypeDescriptorIndicatorsProvides access to the TypeConfiguration for access to various type-system registries.- Specified by:
getTypeConfigurationin interfaceJdbcTypeDescriptorIndicators
-
setExplicitTypeParams
public void setExplicitTypeParams(Map 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:JdbcTypeDescriptorIndicatorsFor temporal type mappings, what precision was requested?- Specified by:
getTemporalPrecisionin interfaceJdbcTypeDescriptorIndicators
-
accept
public Object accept(ValueVisitor visitor)
- Specified by:
acceptin interfaceValue- Overrides:
acceptin classSimpleValue
-
-