Class IdClassEmbeddable
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
-
- org.hibernate.metamodel.mapping.internal.IdClassEmbeddable
-
- All Implemented Interfaces:
Bindable,EmbeddableMappingType,JdbcMappingContainer,ManagedMappingType,MappingModelExpressible,MappingType,ModelPart,ModelPartContainer,NonAggregatedIdentifierMapping.IdentifierValueMapper,SelectableMappings,FetchableContainer
public class IdClassEmbeddable extends AbstractEmbeddableMapping implements NonAggregatedIdentifierMapping.IdentifierValueMapper
EmbeddableMappingType implementation describing anIdClass
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
AbstractEmbeddableMapping.AttributeTypeValidator, AbstractEmbeddableMapping.ConcreteTableResolver, AbstractEmbeddableMapping.IllegalAttributeType, AbstractEmbeddableMapping.SuccessfulCompletionCallback
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.Bindable
Bindable.JdbcValuesConsumer
-
Nested classes/interfaces inherited from interface org.hibernate.metamodel.mapping.ModelPart
ModelPart.IndexedJdbcValueConsumer, ModelPart.JdbcValueConsumer
-
-
Constructor Summary
Constructors Constructor Description IdClassEmbeddable(Component idClassSource, RootClass bootEntityDescriptor, NonAggregatedIdentifierMapping idMapping, EntityMappingType identifiedEntityMapping, String idTable, String[] idColumns, VirtualIdEmbeddable virtualIdEmbeddable, MappingModelCreationProcess creationProcess)IdClassEmbeddable(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, IdClassEmbeddable inverseMappingType, MappingModelCreationProcess creationProcess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbreakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)<T> DomainResult<T>createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)Create a DomainResult for a specific reference to this ModelPart.EmbeddableMappingTypecreateInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess)Objectdisassemble(Object value, SharedSessionContractImplementor session)SingularAttributeMappingfindAttributeMapping(String name)Find an attribute by name.EntityMappingTypefindContainingEntityMapping()ModelPartfindSubPart(String name, EntityMappingType treatTargetType)voidforEachAttributeMapping(Consumer<? super AttributeMapping> action)Visit attributes defined on this class and any supersvoidforEachAttributeMapping(IndexedConsumer<? super AttributeMapping> consumer)Visit attributes defined on this class and any supersintforEachDisassembledJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetintforEachJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)intforEachSelectable(int offset, SelectableConsumer consumer)Visit each contained selectable mapping.intforEachSelectable(SelectableConsumer consumer)Same asSelectableMappings.forEachSelectable(int, SelectableConsumer), with an implicit offset of `0`voidforEachSubPart(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget)AttributeMappinggetAttributeMapping(int position)Retrieve an attribute by its contributor positionAttributeMappingsListgetAttributeMappings()Get access to the attributes defined on this class and any supersEmbeddableValuedModelPartgetEmbeddedPart()EmbeddableValuedModelPartgetEmbeddedValueMapping()FetchablegetFetchable(int position)ObjectgetIdentifier(Object entity, SharedSessionContractImplementor session)Extract the identifier out of the given entity, returning the mapper's representationList<JdbcMapping>getJdbcMappings()The list of JDBC mappingsintgetJdbcTypeCount()The number of JDBC mappingsJavaType<?>getMappedJavaType()The descriptor descriptor for the mapped Java typeNavigableRolegetNavigableRole()intgetNumberOfAttributeMappings()Get the number of attributes defined on this class and any supersintgetNumberOfFetchables()The number of fetchables in the containerStringgetPartName()The local part name, which is generally the unqualified role nameEmbeddableRepresentationStrategygetRepresentationStrategy()SelectableMappinggetSelectable(int columnIndex)Get the selectable at the given positionbooleanisCreateEmptyCompositesEnabled()voidsetIdentifier(Object entity, Object id, SharedSessionContractImplementor session)Extract the identifier out of the given entity, returning the mapper's representationvoidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
finishInitialization, getValues, inverseInitializeCallback, setValues
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableMappingType
anyRequiresAggregateColumnWriter, applySqlSelections, applySqlSelections, compare, forEachInsertable, forEachUpdatable, getAggregateMapping, getJdbcValueCount, getJdbcValueSelectable, getSelectableIndex, requiresAggregateColumnWriter, shouldBindAggregateMapping, shouldMutateAggregateMapping, shouldSelectAggregateMapping
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfFetchableKeys, getNumberOfKeyFetchables, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
getJavaType, getPartMappingType, getValue, getValues, hasPartitionedSelectionMapping, setValue, setValues
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping, decompose, isVirtual
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPartContainer
findByPath, forEachSubPart
-
Methods inherited from interface org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.IdentifierValueMapper
forEachAttribute
-
-
-
-
Constructor Detail
-
IdClassEmbeddable
public IdClassEmbeddable(Component idClassSource, RootClass bootEntityDescriptor, NonAggregatedIdentifierMapping idMapping, EntityMappingType identifiedEntityMapping, String idTable, String[] idColumns, VirtualIdEmbeddable virtualIdEmbeddable, MappingModelCreationProcess creationProcess)
-
IdClassEmbeddable
public IdClassEmbeddable(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, IdClassEmbeddable inverseMappingType, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
getEmbeddedPart
public EmbeddableValuedModelPart getEmbeddedPart()
- Specified by:
getEmbeddedPartin interfaceNonAggregatedIdentifierMapping.IdentifierValueMapper
-
getIdentifier
public Object getIdentifier(Object entity, SharedSessionContractImplementor session)
Description copied from interface:NonAggregatedIdentifierMapping.IdentifierValueMapperExtract the identifier out of the given entity, returning the mapper's representation- Specified by:
getIdentifierin interfaceNonAggregatedIdentifierMapping.IdentifierValueMapper
-
setIdentifier
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
Description copied from interface:NonAggregatedIdentifierMapping.IdentifierValueMapperExtract the identifier out of the given entity, returning the mapper's representation- Specified by:
setIdentifierin interfaceNonAggregatedIdentifierMapping.IdentifierValueMapper
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRolein interfaceModelPart- See Also:
ModelPart.getPartName()
-
getPartName
public String getPartName()
Description copied from interface:ModelPartThe local part name, which is generally the unqualified role name- Specified by:
getPartNamein interfaceModelPart
-
getRepresentationStrategy
public EmbeddableRepresentationStrategy getRepresentationStrategy()
- Specified by:
getRepresentationStrategyin interfaceEmbeddableMappingType
-
getMappedJavaType
public JavaType<?> getMappedJavaType()
Description copied from interface:MappingTypeThe descriptor descriptor for the mapped Java type- Specified by:
getMappedJavaTypein interfaceMappingType- Overrides:
getMappedJavaTypein classAbstractEmbeddableMapping
-
getEmbeddedValueMapping
public EmbeddableValuedModelPart getEmbeddedValueMapping()
- Specified by:
getEmbeddedValueMappingin interfaceEmbeddableMappingType
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()
Description copied from interface:ManagedMappingTypeGet the number of attributes defined on this class and any supers- Specified by:
getNumberOfAttributeMappingsin interfaceManagedMappingType
-
getAttributeMapping
public AttributeMapping getAttributeMapping(int position)
Description copied from interface:ManagedMappingTypeRetrieve an attribute by its contributor position- Specified by:
getAttributeMappingin interfaceManagedMappingType
-
isCreateEmptyCompositesEnabled
public boolean isCreateEmptyCompositesEnabled()
- Specified by:
isCreateEmptyCompositesEnabledin interfaceEmbeddableMappingType
-
findAttributeMapping
public SingularAttributeMapping findAttributeMapping(String name)
Description copied from interface:ManagedMappingTypeFind an attribute by name.- Specified by:
findAttributeMappingin interfaceManagedMappingType- Returns:
- The named attribute, or
nullif no match was found
-
getAttributeMappings
public AttributeMappingsList getAttributeMappings()
Description copied from interface:ManagedMappingTypeGet access to the attributes defined on this class and any supers- Specified by:
getAttributeMappingsin interfaceManagedMappingType
-
forEachAttributeMapping
public void forEachAttributeMapping(Consumer<? super AttributeMapping> action)
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
forEachAttributeMappingin interfaceManagedMappingType
-
forEachAttributeMapping
public void forEachAttributeMapping(IndexedConsumer<? super AttributeMapping> consumer)
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
forEachAttributeMappingin interfaceManagedMappingType
-
getNumberOfFetchables
public int getNumberOfFetchables()
Description copied from interface:FetchableContainerThe number of fetchables in the container- Specified by:
getNumberOfFetchablesin interfaceFetchableContainer
-
getFetchable
public Fetchable getFetchable(int position)
- Specified by:
getFetchablein interfaceFetchableContainer
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMappingin interfaceModelPart
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
- Specified by:
visitSubPartsin interfaceModelPartContainer
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
- Specified by:
findSubPartin interfaceModelPartContainer
-
forEachSubPart
public void forEachSubPart(IndexedConsumer<ModelPart> consumer, EntityMappingType treatTarget)
- Specified by:
forEachSubPartin interfaceModelPartContainer
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValuesin interfaceModelPart
-
getSelectable
public SelectableMapping getSelectable(int columnIndex)
Description copied from interface:SelectableMappingsGet the selectable at the given position- Specified by:
getSelectablein interfaceSelectableMappings
-
forEachSelectable
public int forEachSelectable(SelectableConsumer consumer)
Description copied from interface:SelectableMappingsSame asSelectableMappings.forEachSelectable(int, SelectableConsumer), with an implicit offset of `0`- Specified by:
forEachSelectablein interfaceEmbeddableMappingType- Specified by:
forEachSelectablein interfaceModelPart- Specified by:
forEachSelectablein interfaceSelectableMappings
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)Description copied from interface:SelectableMappingsVisit each contained selectable mapping. As the selectables are iterated, we call `SelectionConsumer` passing along `offset` + our current iteration index. The return is the number of selectables we directly contain- Specified by:
forEachSelectablein interfaceEmbeddableMappingType- Specified by:
forEachSelectablein interfaceModelPart- Specified by:
forEachSelectablein interfaceSelectableMappings- See Also:
SelectableConsumer.accept(int, SelectableMapping)
-
getJdbcTypeCount
public int getJdbcTypeCount()
Description copied from interface:BindableThe number of JDBC mappings- Specified by:
getJdbcTypeCountin interfaceBindable- Specified by:
getJdbcTypeCountin interfaceEmbeddableMappingType- Specified by:
getJdbcTypeCountin interfaceJdbcMappingContainer- Specified by:
getJdbcTypeCountin interfaceSelectableMappings
-
getJdbcMappings
public List<JdbcMapping> getJdbcMappings()
Description copied from interface:BindableThe list of JDBC mappings- Specified by:
getJdbcMappingsin interfaceBindable- Specified by:
getJdbcMappingsin interfaceEmbeddableMappingType- Specified by:
getJdbcMappingsin interfaceJdbcMappingContainer- Specified by:
getJdbcMappingsin interfaceSelectableMappings- See Also:
SqlTypedMapping.getJdbcMapping()
-
forEachJdbcValue
public int forEachJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachJdbcValuein interfaceBindable
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemblein interfaceBindable- See Also:
As an example, consider the following domain model: ````
-
forEachDisassembledJdbcValue
public int forEachDisassembledJdbcValue(Object value, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachDisassembledJdbcValuein interfaceBindable
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Description copied from interface:JdbcMappingContainerVisit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcTypein interfaceEmbeddableMappingType- Specified by:
forEachJdbcTypein interfaceJdbcMappingContainer
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPartCreate a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResultin interfaceEmbeddableMappingType- Specified by:
createDomainResultin interfaceModelPart
-
createInverseMappingType
public EmbeddableMappingType createInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess)
- Specified by:
createInverseMappingTypein interfaceEmbeddableMappingType
-
-