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 interface
BasicValue.Resolution<J>
Resolved form ofBasicValue
as 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 Object
accept(ValueVisitor visitor)
void
addColumn(Column incomingColumn)
void
addColumn(Column incomingColumn, boolean isInsertable, boolean isUpdatable)
void
addFormula(Formula formula)
protected BasicValue.Resolution<?>
buildResolution()
void
copyTypeFrom(SimpleValue sourceValue)
Selectable
getColumn()
long
getColumnLength()
Useful for resolutions based on column length.int
getColumnPrecision()
Useful for resolutions based on column precision.int
getColumnScale()
Useful for resolutions based on column scale.TimeZoneStorageStrategy
getDefaultTimeZoneStorageStrategy()
EnumType
getEnumeratedType()
For enum mappings, what style of storage was requested (name vs.EnumType
getEnumerationStyle()
int
getPreferredSqlTypeCodeForBoolean()
When mapping a boolean type to the database what is the preferred SQL type code to use?BasicValue.Resolution<?>
getResolution()
Type
getResolvedJavaType()
TemporalType
getTemporalPrecision()
For temporal type mappings, what precision was requested?TimeZoneStorageType
getTimeZoneStorageType()
Type
getType()
TypeConfiguration
getTypeConfiguration()
Provides access to the TypeConfiguration for access to various type-system registries.BasicValue.Resolution<?>
resolve()
boolean
resolve(MetadataBuildingContext buildingContext)
void
setEnumerationStyle(EnumType enumerationStyle)
<T extends UserType<?>>
voidsetExplicitCustomType(Class<T> explicitCustomType)
void
setExplicitJavaTypeAccess(Function<TypeConfiguration,BasicJavaType> explicitJavaTypeAccess)
void
setExplicitJdbcTypeAccess(Function<TypeConfiguration,JdbcType> jdbcTypeAccess)
void
setExplicitMutabilityPlanAccess(Function<TypeConfiguration,MutabilityPlan> explicitMutabilityPlanAccess)
void
setExplicitTypeName(String typeName)
void
setExplicitTypeParams(Map explicitLocalTypeParams)
void
setImplicitJavaTypeAccess(Function<TypeConfiguration,Type> implicitJavaTypeAccess)
void
setJpaAttributeConverterDescriptor(ConverterDescriptor descriptor)
void
setTemporalPrecision(TemporalType temporalPrecision)
void
setTimeZoneStorageType(TimeZoneStorageType timeZoneStorageType)
void
setTypeName(String typeName)
void
setTypeUsingReflection(String className, String propertyName)
-
Methods inherited from class org.hibernate.mapping.SimpleValue
createForeignKey, createForeignKeyOfEntity, createIdentifierGenerator, createIdentifierGenerator, createParameterImpl, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumnIterator, getColumnSpan, getColumnUpdateability, getConstraintColumnIterator, getConstraintColumns, getCustomIdGeneratorCreator, 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, 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.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:
setTypeUsingReflection
in interfaceValue
- Overrides:
setTypeUsingReflection
in 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:
setJpaAttributeConverterDescriptor
in 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:JdbcTypeDescriptorIndicators
Useful for resolutions based on column length. E.g. choosing between a VARCHAR (String) and a CHAR(1) (Character/char)- Specified by:
getColumnLength
in interfaceJdbcTypeDescriptorIndicators
-
getColumnPrecision
public int getColumnPrecision()
Description copied from interface:JdbcTypeDescriptorIndicators
Useful for resolutions based on column precision.- Specified by:
getColumnPrecision
in interfaceJdbcTypeDescriptorIndicators
-
getColumnScale
public int getColumnScale()
Description copied from interface:JdbcTypeDescriptorIndicators
Useful for resolutions based on column scale. E.g. choosing between a NUMERIC or INTERVAL- Specified by:
getColumnScale
in interfaceJdbcTypeDescriptorIndicators
-
addColumn
public void addColumn(Column incomingColumn)
- Overrides:
addColumn
in classSimpleValue
-
copyTypeFrom
public void copyTypeFrom(SimpleValue sourceValue)
- Overrides:
copyTypeFrom
in classSimpleValue
-
addColumn
public void addColumn(Column incomingColumn, boolean isInsertable, boolean isUpdatable)
- Overrides:
addColumn
in classSimpleValue
-
addFormula
public void addFormula(Formula formula)
- Overrides:
addFormula
in classSimpleValue
-
getType
public Type getType() throws MappingException
- Specified by:
getType
in interfaceValue
- Throws:
MappingException
-
getResolution
public BasicValue.Resolution<?> getResolution()
-
resolve
public boolean resolve(MetadataBuildingContext buildingContext)
- Specified by:
resolve
in interfaceResolvable
-
resolve
public BasicValue.Resolution<?> resolve()
- Specified by:
resolve
in interfaceResolvable
-
buildResolution
protected BasicValue.Resolution<?> buildResolution()
-
getEnumeratedType
public EnumType getEnumeratedType()
Description copied from interface:JdbcTypeDescriptorIndicators
For enum mappings, what style of storage was requested (name vs. ordinal)?- Specified by:
getEnumeratedType
in interfaceJdbcTypeDescriptorIndicators
- Returns:
- The enum type.
-
getPreferredSqlTypeCodeForBoolean
public int getPreferredSqlTypeCodeForBoolean()
Description copied from interface:JdbcTypeDescriptorIndicators
When mapping a boolean type to the database what is the preferred SQL type code to use? Specifically names the key into theJdbcTypeRegistry
.- Specified by:
getPreferredSqlTypeCodeForBoolean
in interfaceJdbcTypeDescriptorIndicators
-
getDefaultTimeZoneStorageStrategy
public TimeZoneStorageStrategy getDefaultTimeZoneStorageStrategy()
- Specified by:
getDefaultTimeZoneStorageStrategy
in interfaceJdbcTypeDescriptorIndicators
-
getTypeConfiguration
public TypeConfiguration getTypeConfiguration()
Description copied from interface:JdbcTypeDescriptorIndicators
Provides access to the TypeConfiguration for access to various type-system registries.- Specified by:
getTypeConfiguration
in interfaceJdbcTypeDescriptorIndicators
-
setExplicitTypeParams
public void setExplicitTypeParams(Map explicitLocalTypeParams)
-
setExplicitTypeName
public void setExplicitTypeName(String typeName)
-
setTypeName
public void setTypeName(String typeName)
- Overrides:
setTypeName
in 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:JdbcTypeDescriptorIndicators
For temporal type mappings, what precision was requested?- Specified by:
getTemporalPrecision
in interfaceJdbcTypeDescriptorIndicators
-
accept
public Object accept(ValueVisitor visitor)
- Specified by:
accept
in interfaceValue
- Overrides:
accept
in classSimpleValue
-
-