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 classstatic class -
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) voidvoidvoidcheckColumnDuplication(Set<String> distinctColumns, String owner) Checks if this value contains any duplicate column.copy()createGenerator(IdentifierGeneratorFactory identifierGeneratorFactory, Dialect dialect, RootClass rootClass) boolean[]If the mapping involves only columns, return them.intThe 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) Deprecated.String[]intThe mapping to columns and formulas.String[]getType()booleanbooleanbooleanbooleanhasProperty(String propertyName) booleanbooleanbooleanbooleanisKey()booleanbooleanisSame(SimpleValue other) booleanisSorted()booleanbooleanmatchesAllProperties(String... propertyNames) voidvoidsetAggregateColumn(AggregateColumn aggregateColumn) voidsetComponentClassName(String componentClass) voidsetCustomInstantiator(Class<? extends EmbeddableInstantiator> customInstantiator) voidsetDynamic(boolean dynamic) voidsetEmbedded(boolean embedded) voidsetGeneric(boolean generic) voidsetInstantiator(Constructor<?> instantiator, String[] instantiatorPropertyNames) voidsetKey(boolean isKey) voidsetMetaAttributes(Map<String, MetaAttribute> metas) voidsetOwner(PersistentClass owner) voidsetParentAggregateColumn(AggregateColumn parentAggregateColumn) voidsetParentProperty(String parentProperty) voidsetRoleName(String roleName) voidsetStructColumnNames(String[] structColumnNames) voidsetStructName(String structName) voidsetTypeUsingReflection(String className, String propertyName) int[]toString()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, sortColumnsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.mapping.KeyValue
createIdentifierGenerator, createIdentifierGeneratorMethods inherited from interface org.hibernate.mapping.Value
getConstraintColumns, getExtraCreateTableInfo, getSelectableType, getVirtualSelectables
-
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() -
getPropertyIterator
Deprecated. -
getProperties
-
addProperty
-
addColumn
- Overrides:
addColumnin classSimpleValue
-
getSelectables
Description copied from interface:ValueThe mapping to columns and formulas.- Specified by:
getSelectablesin interfaceValue- Overrides:
getSelectablesin classSimpleValue
-
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
-
setAggregateColumn
-
getColumnSpan
public int getColumnSpan()Description copied from interface:ValueThe number of columns and formulas in the mapping.- Specified by:
getColumnSpanin interfaceValue- Overrides:
getColumnSpanin classSimpleValue
-
getAggregatedColumns
-
getParentAggregateColumn
-
setParentAggregateColumn
-
getStructName
-
setStructName
-
checkColumnDuplication
Description copied from interface:ValueChecks if this value contains any duplicate column. A column is considered duplicate when itsnameis already contained in thedistinctColumnset.If a duplicate column is found, a
MappingExceptionis thrown.- Specified by:
checkColumnDuplicationin 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:
getTypein interfaceValue- Throws:
MappingException
-
setTypeUsingReflection
- Specified by:
setTypeUsingReflectionin interfaceValue- Overrides:
setTypeUsingReflectionin classSimpleValue- Throws:
MappingException
-
getMetaAttributes
- Specified by:
getMetaAttributesin interfaceMetaAttributable
-
getMetaAttribute
- Specified by:
getMetaAttributein interfaceMetaAttributable
-
setMetaAttributes
- Specified by:
setMetaAttributesin interfaceMetaAttributable
-
accept
- Specified by:
acceptin interfaceValue- Overrides:
acceptin classSimpleValue
-
isSame
- Overrides:
isSamein classSimpleValue
-
isSame
-
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
- Parameters:
index- index of thePropertyto return- Returns:
Property- Throws:
IndexOutOfBoundsException- - if the index is out of range(index < 0 || index >=getPropertySpan())
-
getProperty
- Throws:
MappingException
-
matchesAllProperties
-
hasProperty
-
getRoleName
-
setRoleName
-
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
-
prepareForMappingModel
public void prepareForMappingModel() -
isValid
- 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
-
setCustomInstantiator
-
getInstantiator
-
getInstantiatorPropertyNames
-
setInstantiator
-
getStructColumnNames
-
setStructColumnNames
-
isGeneric
public boolean isGeneric() -
setGeneric
public void setGeneric(boolean generic)
-