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,Queryable,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.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)EntityMappingTypefindContainingEntityMapping()ModelPartfindSubPart(String name, EntityMappingType treatTargetType)For an entity, this form allows for Hibernate's "implicit treat" support - meaning it should find a sub-part whether defined on the entity, its super-type or even one of its sub-types.voidforEachAttributeMapping(IndexedConsumer<AttributeMapping> consumer)Visit attributes defined on this class and any supersintforEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)intforEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)Visit each JdbcMapping starting from the given offsetintforEachJdbcValue(Object value, Clause clause, 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`AttributeMappinggetAttributeMapping(int position)Retrieve an attribute by its contributor positionList<AttributeMapping>getAttributeMappings()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()NavigableRolegetNavigableRole()intgetNumberOfAttributeMappings()Get the number of attributes defined on this class and any supersintgetNumberOfFetchables()The number of fetchables in the containerStringgetPartName()EmbeddableRepresentationStrategygetRepresentationStrategy()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 representationvoidvisitAttributeMappings(Consumer<? super AttributeMapping> action)Visit attributes defined on this class and any supersvoidvisitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)LikeQueryable.findSubPart(java.lang.String, org.hibernate.metamodel.mapping.EntityMappingType), this form visits all parts defined on the entity, its super-types and its sub-types.-
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
applySqlSelections, applySqlSelections
-
Methods inherited from interface org.hibernate.sql.results.graph.FetchableContainer
getKeyFetchable, getNumberOfKeyFetchables, visitFetchables, visitFetchables, visitFetchables, visitKeyFetchables, visitKeyFetchables, visitKeyFetchables
-
Methods inherited from interface org.hibernate.metamodel.mapping.ManagedMappingType
getJavaType, getPartMappingType, getValue, getValues, setValue, setValues
-
Methods inherited from interface org.hibernate.metamodel.mapping.ModelPart
areEqual, asAttributeMapping
-
Methods inherited from interface org.hibernate.metamodel.mapping.NonAggregatedIdentifierMapping.IdentifierValueMapper
forEachAttribute
-
Methods inherited from interface org.hibernate.metamodel.mapping.Queryable
findByPath, findSubTypesSubPart, resolveSubPart
-
-
-
-
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()
- Specified by:
getPartNamein interfaceModelPart
-
getRepresentationStrategy
public EmbeddableRepresentationStrategy getRepresentationStrategy()
- Specified by:
getRepresentationStrategyin interfaceEmbeddableMappingType
-
getMappedJavaType
public JavaType<?> getMappedJavaType()
- 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)
- Specified by:
findAttributeMappingin interfaceManagedMappingType
-
getAttributeMappings
public List<AttributeMapping> getAttributeMappings()
Description copied from interface:ManagedMappingTypeGet access to the attributes defined on this class and any supers- Specified by:
getAttributeMappingsin interfaceManagedMappingType
-
visitAttributeMappings
public void visitAttributeMappings(Consumer<? super AttributeMapping> action)
Description copied from interface:ManagedMappingTypeVisit attributes defined on this class and any supers- Specified by:
visitAttributeMappingsin interfaceManagedMappingType
-
forEachAttributeMapping
public void forEachAttributeMapping(IndexedConsumer<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)
Description copied from interface:QueryableLikeQueryable.findSubPart(java.lang.String, org.hibernate.metamodel.mapping.EntityMappingType), this form visits all parts defined on the entity, its super-types and its sub-types.- Specified by:
visitSubPartsin interfaceQueryable
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
Description copied from interface:QueryableFor an entity, this form allows for Hibernate's "implicit treat" support - meaning it should find a sub-part whether defined on the entity, its super-type or even one of its sub-types.- Specified by:
findSubPartin interfaceQueryable
-
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, Clause clause, 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, Clause clause, 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
-
-