Package org.hibernate.mapping
Class Component
java.lang.Object
org.hibernate.mapping.SimpleValue
org.hibernate.mapping.Component
- All Implemented Interfaces:
Serializable
,KeyValue
,MetaAttributable
,SortableValue
,Value
A mapping model object that represents an embeddable class.
- See Also:
- API Note:
- The name of this class is historical and unfortunate. It reflects modeling a *composition* of state. It has absolutely nothing to do with modularity in software engineering.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from interface org.hibernate.mapping.KeyValue
KeyValue.NullValueSemantic
-
Field Summary
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGY
-
Constructor Summary
ConstructorsConstructorDescriptionComponent
(MetadataBuildingContext metadata, Collection collection) Component
(MetadataBuildingContext metadata, Component component) Component
(MetadataBuildingContext metadata, Join join) Component
(MetadataBuildingContext metadata, PersistentClass owner) Component
(MetadataBuildingContext metadata, Table table, PersistentClass owner) -
Method Summary
Modifier and TypeMethodDescriptionaccept
(ValueVisitor visitor) void
void
void
addProperty
(Property p, org.hibernate.models.spi.ClassDetails declaringClass) void
checkColumnDuplication
(Set<String> distinctColumns, String owner) Checks if this value contains any duplicate column.void
copy()
createGenerator
(Dialect dialect, RootClass rootClass, Property property, GeneratorSettings defaults) boolean[]
If the mapping involves only columns, return them.int
The number of columns and formulas in the mapping.boolean[]
Class<?>
Class<? extends EmbeddableInstantiator>
Constructor<?>
String[]
getMetaAttribute
(String attributeName) getOwner()
getProperty
(int index) getProperty
(String propertyName) String[]
int
The mapping to columns and formulas.String[]
getSuperclass
(String subclass) getType()
boolean
boolean
boolean
hasProperty
(String propertyName) boolean
boolean
boolean
boolean
isKey()
boolean
boolean
boolean
isSame
(SimpleValue other) boolean
boolean
isSorted()
boolean
isValid
(MappingContext mappingContext) boolean
matchesAllProperties
(String... propertyNames) void
void
setAggregateColumn
(AggregateColumn aggregateColumn) void
setComponentClassName
(String componentClass) void
setCustomInstantiator
(Class<? extends EmbeddableInstantiator> customInstantiator) void
setDiscriminator
(Value discriminator) void
setDiscriminatorValues
(Map<Object, String> discriminatorValues) void
setDynamic
(boolean dynamic) void
setEmbedded
(boolean embedded) void
setGeneric
(boolean generic) void
setInstantiator
(Constructor<?> instantiator, String[] instantiatorPropertyNames) void
setKey
(boolean isKey) void
setMappedSuperclass
(MappedSuperclass mappedSuperclass) void
setMetaAttributes
(Map<String, MetaAttribute> metas) void
setOwner
(PersistentClass owner) void
setParentAggregateColumn
(AggregateColumn parentAggregateColumn) void
setParentProperty
(String parentProperty) void
setRoleName
(String roleName) void
setSimpleRecord
(boolean simpleRecord) void
setStructColumnNames
(String[] structColumnNames) void
setStructName
(QualifiedName structName) void
setSubclassToSuperclass
(Map<String, String> subclassToSuperclass) void
setTypeUsingReflection
(String className, String propertyName) int[]
toString()
Methods inherited from class org.hibernate.mapping.SimpleValue
addColumn, addFormula, copyTypeFrom, createForeignKey, createForeignKey, createForeignKeyOfEntity, createGenerator, createParameterImpl, createUniqueKey, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getCustomIdGeneratorCreator, getFetchMode, getForeignKeyDefinition, getForeignKeyName, getForeignKeyOptions, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getNullValueSemantic, getOnDeleteAction, getServiceRegistry, getTable, getTypeConfiguration, getTypeName, getTypeParameters, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isColumnInsertable, isColumnUpdateable, isConstrained, isForeignKeyEnabled, isLob, isNationalized, isNullable, isPartitionKey, isSame, isSame, isSimpleValue, isTypeSpecified, isUpdateable, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeParameterImpl, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setColumnToIdentity, setCustomIdGeneratorCreator, setForeignKeyDefinition, setForeignKeyName, setForeignKeyOptions, setJpaAttributeConverterDescriptor, setNullValue, setNullValueSemantic, setNullValueUndefined, setOnDeleteAction, setPartitionKey, setTable, setTypeName, setTypeParameters, setTypeParameters, sortColumns
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hibernate.mapping.Value
getConstraintColumns, getExtraCreateTableInfo, getSelectableType, getSelectableType, getVirtualSelectables, isValid
-
Constructor Details
-
Component
- Throws:
MappingException
-
Component
- Throws:
MappingException
-
Component
- Throws:
MappingException
-
Component
- Throws:
MappingException
-
Component
public Component(MetadataBuildingContext metadata, Table table, PersistentClass owner) throws MappingException - Throws:
MappingException
-
-
Method Details
-
copy
-
getPropertySpan
public int getPropertySpan() -
getProperties
-
addProperty
-
addProperty
-
getPropertyDeclaringClass
-
addColumn
- Overrides:
addColumn
in classSimpleValue
-
getSelectables
Description copied from interface:Value
The mapping to columns and formulas.- Specified by:
getSelectables
in interfaceValue
- Overrides:
getSelectables
in classSimpleValue
-
getColumns
Description copied from interface:Value
If the mapping involves only columns, return them.- Specified by:
getColumns
in interfaceValue
- Overrides:
getColumns
in classSimpleValue
-
isEmbedded
public boolean isEmbedded() -
getAggregateColumn
-
setAggregateColumn
-
getColumnSpan
public int getColumnSpan()Description copied from interface:Value
The number of columns and formulas in the mapping.- Specified by:
getColumnSpan
in interfaceValue
- Overrides:
getColumnSpan
in classSimpleValue
-
getAggregatedColumns
-
getParentAggregateColumn
-
setParentAggregateColumn
-
getStructName
-
setStructName
-
checkColumnDuplication
Description copied from interface:Value
Checks if this value contains any duplicate column. A column is considered duplicate when itsname
is already contained in thedistinctColumn
set.If a duplicate column is found, a
MappingException
is thrown.- Specified by:
checkColumnDuplication
in interfaceValue
- Parameters:
distinctColumns
- set containing the names of the columns to checkowner
- the owner of this value, used just for error reporting
-
getComponentClassName
-
getComponentClass
- Throws:
MappingException
-
getOwner
-
getParentProperty
-
setComponentClassName
-
setEmbedded
public void setEmbedded(boolean embedded) -
setOwner
-
setParentProperty
-
isDynamic
public boolean isDynamic() -
setDynamic
public void setDynamic(boolean dynamic) -
getType
- Specified by:
getType
in interfaceValue
- Throws:
MappingException
-
setTypeUsingReflection
- Specified by:
setTypeUsingReflection
in interfaceValue
- Overrides:
setTypeUsingReflection
in classSimpleValue
- Throws:
MappingException
-
getMetaAttributes
- Specified by:
getMetaAttributes
in interfaceMetaAttributable
-
getMetaAttribute
- Specified by:
getMetaAttribute
in interfaceMetaAttributable
-
setMetaAttributes
- Specified by:
setMetaAttributes
in interfaceMetaAttributable
-
accept
- Specified by:
accept
in interfaceValue
- Overrides:
accept
in classSimpleValue
-
isSame
- Overrides:
isSame
in classSimpleValue
-
isSame
-
getColumnInsertability
public boolean[] getColumnInsertability()- Specified by:
getColumnInsertability
in interfaceValue
- Overrides:
getColumnInsertability
in classSimpleValue
-
hasAnyInsertableColumns
public boolean hasAnyInsertableColumns()- Specified by:
hasAnyInsertableColumns
in interfaceValue
- Overrides:
hasAnyInsertableColumns
in classSimpleValue
-
getColumnUpdateability
public boolean[] getColumnUpdateability()- Specified by:
getColumnUpdateability
in interfaceValue
- Overrides:
getColumnUpdateability
in classSimpleValue
-
hasAnyUpdatableColumns
public boolean hasAnyUpdatableColumns()- Specified by:
hasAnyUpdatableColumns
in interfaceValue
- Overrides:
hasAnyUpdatableColumns
in classSimpleValue
-
isKey
public boolean isKey() -
setKey
public void setKey(boolean isKey) -
getProperty
- Parameters:
index
- index of theProperty
to return- Returns:
Property
- Throws:
IndexOutOfBoundsException
- - if the index is out of range(index < 0 || index >=getPropertySpan()
)
-
getProperty
- Throws:
MappingException
-
matchesAllProperties
-
hasProperty
-
getRoleName
-
setRoleName
-
getMappedSuperclass
-
setMappedSuperclass
-
getDiscriminator
-
setDiscriminator
-
getDiscriminatorType
-
isPolymorphic
public boolean isPolymorphic() -
getDiscriminatorValues
-
setDiscriminatorValues
-
getSuperclass
-
setSubclassToSuperclass
-
toString
- Overrides:
toString
in classSimpleValue
-
createGenerator
public Generator createGenerator(Dialect dialect, RootClass rootClass, Property property, GeneratorSettings defaults) - Specified by:
createGenerator
in interfaceKeyValue
- Overrides:
createGenerator
in classSimpleValue
-
getPropertyNames
-
clearProperties
public void clearProperties() -
prepareForMappingModel
public void prepareForMappingModel() -
isValid
- Specified by:
isValid
in interfaceValue
- Overrides:
isValid
in classSimpleValue
- Throws:
MappingException
-
isSorted
public boolean isSorted()- Specified by:
isSorted
in interfaceSortableValue
-
sortProperties
public int[] sortProperties()- Specified by:
sortProperties
in interfaceSortableValue
-
setSimpleRecord
public void setSimpleRecord(boolean simpleRecord) -
isSimpleRecord
public boolean isSimpleRecord() -
getCustomInstantiator
-
setCustomInstantiator
-
getInstantiator
-
getInstantiatorPropertyNames
-
setInstantiator
-
getStructColumnNames
-
setStructColumnNames
-
isGeneric
public boolean isGeneric() -
setGeneric
public void setGeneric(boolean generic)
-