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
public class Component extends SimpleValue implements MetaAttributable, SortableValue
A mapping model object that represents an embeddable class.- See Also:
- Serialized Form
- "API Note:"
- The name of this class is historical and unfortunate. An embeddable class holds a "component" of the state of an entity. It has absolutely nothing to do with modularity in software engineering.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classComponent.StandardGenerationContextLocatorstatic classComponent.ValueGenerationPlan
-
Field Summary
-
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description Component(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
-
Methods inherited from class org.hibernate.mapping.SimpleValue
addColumn, addFormula, copyTypeFrom, createForeignKey, createForeignKey, createForeignKeyOfEntity, createParameterImpl, createUniqueKey, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getConstraintColumnIterator, getCustomIdGeneratorCreator, getFetchMode, getForeignKeyDefinition, getForeignKeyName, getIdentifierGenerator, getIdentifierGeneratorParameters, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getOnDeleteAction, getServiceRegistry, getTable, getTypeConfiguration, getTypeName, getTypeParameters, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isColumnInsertable, isColumnUpdateable, isConstrained, isForeignKeyEnabled, isIdentityColumn, isLob, isNationalized, isNullable, isPartitionKey, isSame, isSame, isSimpleValue, isTypeSpecified, isUpdateable, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeParameterImpl, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setCascadeDeleteEnabled, setCustomIdGeneratorCreator, setForeignKeyDefinition, setForeignKeyName, setIdentifierGeneratorParameters, setIdentifierGeneratorProperties, setIdentifierGeneratorProperties, setIdentifierGeneratorStrategy, setJpaAttributeConverterDescriptor, setNullValue, 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.KeyValue
createIdentifierGenerator, createIdentifierGenerator
-
Methods inherited from interface org.hibernate.mapping.Value
getConstraintColumns, getExtraCreateTableInfo, getSelectableType, getVirtualSelectables
-
-
-
-
Constructor Detail
-
Component
public Component(MetadataBuildingContext metadata, PersistentClass owner) throws MappingException
- Throws:
MappingException
-
Component
public Component(MetadataBuildingContext metadata, Component component) throws MappingException
- Throws:
MappingException
-
Component
public Component(MetadataBuildingContext metadata, Join join) throws MappingException
- Throws:
MappingException
-
Component
public Component(MetadataBuildingContext metadata, Collection collection) throws MappingException
- Throws:
MappingException
-
Component
public Component(MetadataBuildingContext metadata, Table table, PersistentClass owner) throws MappingException
- Throws:
MappingException
-
-
Method Detail
-
getPropertySpan
public int getPropertySpan()
-
getPropertyIterator
@Deprecated public Iterator<Property> getPropertyIterator()
Deprecated.
-
addProperty
public void addProperty(Property p)
-
addColumn
public void addColumn(Column column)
- Overrides:
addColumnin classSimpleValue
-
getColumnSpan
public int getColumnSpan()
Description copied from interface:ValueThe number of columns and formulas in the mapping.- Specified by:
getColumnSpanin interfaceValue- Overrides:
getColumnSpanin classSimpleValue
-
getColumnIterator
@Deprecated public Iterator<Selectable> getColumnIterator()
Deprecated.- Specified by:
getColumnIteratorin interfaceValue- Overrides:
getColumnIteratorin classSimpleValue
-
getSelectables
public List<Selectable> getSelectables()
Description copied from interface:ValueThe mapping to columns and formulas.- Specified by:
getSelectablesin interfaceValue- Overrides:
getSelectablesin classSimpleValue
-
getColumns
public List<Column> getColumns()
Description copied from interface:ValueIf the mapping involves only columns, return them.- Specified by:
getColumnsin interfaceValue- Overrides:
getColumnsin classSimpleValue
-
isEmbedded
public boolean isEmbedded()
-
getAggregateColumn
public AggregateColumn getAggregateColumn()
-
setAggregateColumn
public void setAggregateColumn(AggregateColumn aggregateColumn)
-
getParentAggregateColumn
public AggregateColumn getParentAggregateColumn()
-
setParentAggregateColumn
public void setParentAggregateColumn(AggregateColumn parentAggregateColumn)
-
getStructName
public String getStructName()
-
setStructName
public void setStructName(String structName)
-
checkColumnDuplication
protected void checkColumnDuplication() throws MappingException- Throws:
MappingException
-
checkColumnDuplication
protected void checkColumnDuplication(Set<String> distinctColumns, Value value) throws MappingException
- Throws:
MappingException
-
checkPropertyColumnDuplication
protected void checkPropertyColumnDuplication(Set<String> distinctColumns, List<Property> properties) throws MappingException
- Throws:
MappingException
-
getComponentClassName
public String getComponentClassName()
-
getComponentClass
public Class<?> getComponentClass() throws MappingException
- Throws:
MappingException
-
getOwner
public PersistentClass getOwner()
-
getParentProperty
public String getParentProperty()
-
setComponentClassName
public void setComponentClassName(String componentClass)
-
setEmbedded
public void setEmbedded(boolean embedded)
-
setOwner
public void setOwner(PersistentClass owner)
-
setParentProperty
public void setParentProperty(String parentProperty)
-
isDynamic
public boolean isDynamic()
-
setDynamic
public void setDynamic(boolean dynamic)
-
getType
public CompositeType getType() throws MappingException
- Specified by:
getTypein interfaceValue- Throws:
MappingException
-
setTypeUsingReflection
public void setTypeUsingReflection(String className, String propertyName) throws MappingException
- Specified by:
setTypeUsingReflectionin interfaceValue- Overrides:
setTypeUsingReflectionin classSimpleValue- Throws:
MappingException
-
getMetaAttributes
public Map<String,MetaAttribute> getMetaAttributes()
- Specified by:
getMetaAttributesin interfaceMetaAttributable
-
getMetaAttribute
public MetaAttribute getMetaAttribute(String attributeName)
- Specified by:
getMetaAttributein interfaceMetaAttributable
-
setMetaAttributes
public void setMetaAttributes(Map<String,MetaAttribute> metas)
- Specified by:
setMetaAttributesin interfaceMetaAttributable
-
accept
public Object accept(ValueVisitor visitor)
- Specified by:
acceptin interfaceValue- Overrides:
acceptin classSimpleValue
-
isSame
public boolean isSame(SimpleValue other)
- Overrides:
isSamein classSimpleValue
-
isSame
public boolean isSame(Component other)
-
getColumnInsertability
public boolean[] getColumnInsertability()
- Specified by:
getColumnInsertabilityin interfaceValue- Overrides:
getColumnInsertabilityin classSimpleValue
-
hasAnyInsertableColumns
public boolean hasAnyInsertableColumns()
- Specified by:
hasAnyInsertableColumnsin interfaceValue- Overrides:
hasAnyInsertableColumnsin classSimpleValue
-
getColumnUpdateability
public boolean[] getColumnUpdateability()
- Specified by:
getColumnUpdateabilityin interfaceValue- Overrides:
getColumnUpdateabilityin classSimpleValue
-
hasAnyUpdatableColumns
public boolean hasAnyUpdatableColumns()
- Specified by:
hasAnyUpdatableColumnsin interfaceValue- Overrides:
hasAnyUpdatableColumnsin classSimpleValue
-
isKey
public boolean isKey()
-
setKey
public void setKey(boolean isKey)
-
hasPojoRepresentation
public boolean hasPojoRepresentation()
-
getProperty
public Property getProperty(int index)
- Parameters:
index- index of thePropertyto return- Returns:
Property- Throws:
IndexOutOfBoundsException- - if the index is out of range(index < 0 || index >=getPropertySpan())
-
getProperty
public Property getProperty(String propertyName) throws MappingException
- Throws:
MappingException
-
hasProperty
public boolean hasProperty(String propertyName)
-
getRoleName
public String getRoleName()
-
setRoleName
public void setRoleName(String roleName)
-
toString
public String toString()
- Overrides:
toStringin classSimpleValue
-
createGenerator
public Generator createGenerator(IdentifierGeneratorFactory identifierGeneratorFactory, Dialect dialect, RootClass rootClass) throws MappingException
- Specified by:
createGeneratorin interfaceKeyValue- Overrides:
createGeneratorin classSimpleValue- Throws:
MappingException
-
getPropertyNames
public String[] getPropertyNames()
-
prepareForMappingModel
public void prepareForMappingModel()
-
isValid
public boolean isValid(Mapping mapping) throws MappingException
- Specified by:
isValidin interfaceValue- Overrides:
isValidin classSimpleValue- Throws:
MappingException
-
isSorted
public boolean isSorted()
- Specified by:
isSortedin interfaceSortableValue
-
sortProperties
public int[] sortProperties()
- Specified by:
sortPropertiesin interfaceSortableValue
-
getCustomInstantiator
public Class<? extends EmbeddableInstantiator> getCustomInstantiator()
-
setCustomInstantiator
public void setCustomInstantiator(Class<? extends EmbeddableInstantiator> customInstantiator)
-
getInstantiator
public Constructor<?> getInstantiator()
-
getInstantiatorPropertyNames
public String[] getInstantiatorPropertyNames()
-
setInstantiator
public void setInstantiator(Constructor<?> instantiator, String[] instantiatorPropertyNames)
-
getStructColumnNames
public String[] getStructColumnNames()
-
setStructColumnNames
public void setStructColumnNames(String[] structColumnNames)
-
isGeneric
public boolean isGeneric()
-
setGeneric
public void setGeneric(boolean generic)
-
-