Class VirtualIdEmbeddable
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractEmbeddableMapping
-
- org.hibernate.metamodel.mapping.internal.VirtualIdEmbeddable
-
- All Implemented Interfaces:
Bindable
,EmbeddableMappingType
,JdbcMappingContainer
,ManagedMappingType
,MappingModelExpressible
,MappingType
,ModelPart
,ModelPartContainer
,NonAggregatedIdentifierMapping.IdentifierValueMapper
,Queryable
,SelectableMappings
,FetchableContainer
public class VirtualIdEmbeddable extends AbstractEmbeddableMapping implements NonAggregatedIdentifierMapping.IdentifierValueMapper
Embeddable describing the virtual-id aspect of a non-aggregated composite id
-
-
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 VirtualIdEmbeddable(Component virtualIdSource, NonAggregatedIdentifierMapping idMapping, EntityPersister identifiedEntityMapping, String rootTableExpression, String[] rootTableKeyColumnNames, MappingModelCreationProcess creationProcess)
VirtualIdEmbeddable(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, VirtualIdEmbeddable inverseMappingType, MappingModelCreationProcess creationProcess)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
breakDownJdbcValues(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.EmbeddableMappingType
createInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess)
Object
disassemble(Object value, SharedSessionContractImplementor session)
AttributeMapping
findAttributeMapping(String name)
EntityMappingType
findContainingEntityMapping()
ModelPart
findSubPart(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.void
forEachAttributeMapping(IndexedConsumer<AttributeMapping> consumer)
Visit attributes defined on this class and any supersint
forEachDisassembledJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
int
forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Visit each JdbcMapping starting from the given offsetint
forEachJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
int
forEachSelectable(int offset, SelectableConsumer consumer)
Visit each contained selectable mapping.int
forEachSelectable(SelectableConsumer consumer)
Same asSelectableMappings.forEachSelectable(int, SelectableConsumer)
, with an implicit offset of `0`AttributeMapping
getAttributeMapping(int position)
Retrieve an attribute by its contributor positionList<AttributeMapping>
getAttributeMappings()
Get access to the attributes defined on this class and any supersEmbeddableValuedModelPart
getEmbeddedPart()
EmbeddableValuedModelPart
getEmbeddedValueMapping()
Fetchable
getFetchable(int position)
Object
getIdentifier(Object entity, SharedSessionContractImplementor session)
Extract the identifier out of the given entity, returning the mapper's representationList<JdbcMapping>
getJdbcMappings()
The list of JDBC mappingsint
getJdbcTypeCount()
The number of JDBC mappingsNavigableRole
getNavigableRole()
int
getNumberOfAttributeMappings()
Get the number of attributes defined on this class and any supersint
getNumberOfFetchables()
The number of fetchables in the containerString
getPartName()
VirtualIdRepresentationStrategy
getRepresentationStrategy()
SelectableMapping
getSelectable(int columnIndex)
Get the selectable at the given positionboolean
isCreateEmptyCompositesEnabled()
void
setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
Extract the identifier out of the given entity, returning the mapper's representationvoid
visitAttributeMappings(Consumer<? super AttributeMapping> action)
Visit attributes defined on this class and any supersvoid
visitSubParts(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, getMappedJavaType, 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.MappingType
getMappedJavaType
-
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
-
VirtualIdEmbeddable
public VirtualIdEmbeddable(Component virtualIdSource, NonAggregatedIdentifierMapping idMapping, EntityPersister identifiedEntityMapping, String rootTableExpression, String[] rootTableKeyColumnNames, MappingModelCreationProcess creationProcess)
-
VirtualIdEmbeddable
public VirtualIdEmbeddable(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, VirtualIdEmbeddable inverseMappingType, MappingModelCreationProcess creationProcess)
-
-
Method Detail
-
getEmbeddedPart
public EmbeddableValuedModelPart getEmbeddedPart()
- Specified by:
getEmbeddedPart
in interfaceNonAggregatedIdentifierMapping.IdentifierValueMapper
-
getIdentifier
public Object getIdentifier(Object entity, SharedSessionContractImplementor session)
Description copied from interface:NonAggregatedIdentifierMapping.IdentifierValueMapper
Extract the identifier out of the given entity, returning the mapper's representation- Specified by:
getIdentifier
in interfaceNonAggregatedIdentifierMapping.IdentifierValueMapper
-
setIdentifier
public void setIdentifier(Object entity, Object id, SharedSessionContractImplementor session)
Description copied from interface:NonAggregatedIdentifierMapping.IdentifierValueMapper
Extract the identifier out of the given entity, returning the mapper's representation- Specified by:
setIdentifier
in interfaceNonAggregatedIdentifierMapping.IdentifierValueMapper
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRole
in interfaceModelPart
- See Also:
ModelPart.getPartName()
-
getPartName
public String getPartName()
- Specified by:
getPartName
in interfaceModelPart
-
getEmbeddedValueMapping
public EmbeddableValuedModelPart getEmbeddedValueMapping()
- Specified by:
getEmbeddedValueMapping
in interfaceEmbeddableMappingType
-
getRepresentationStrategy
public VirtualIdRepresentationStrategy getRepresentationStrategy()
- Specified by:
getRepresentationStrategy
in interfaceEmbeddableMappingType
-
findAttributeMapping
public AttributeMapping findAttributeMapping(String name)
- Specified by:
findAttributeMapping
in interfaceManagedMappingType
-
getSelectable
public SelectableMapping getSelectable(int columnIndex)
Description copied from interface:SelectableMappings
Get the selectable at the given position- Specified by:
getSelectable
in interfaceSelectableMappings
-
forEachSelectable
public int forEachSelectable(SelectableConsumer consumer)
Description copied from interface:SelectableMappings
Same asSelectableMappings.forEachSelectable(int, SelectableConsumer)
, with an implicit offset of `0`- Specified by:
forEachSelectable
in interfaceEmbeddableMappingType
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)
Description copied from interface:SelectableMappings
Visit 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:
forEachSelectable
in interfaceEmbeddableMappingType
- Specified by:
forEachSelectable
in interfaceModelPart
- Specified by:
forEachSelectable
in interfaceSelectableMappings
- See Also:
SelectableConsumer.accept(int, SelectableMapping)
-
getJdbcTypeCount
public int getJdbcTypeCount()
Description copied from interface:Bindable
The number of JDBC mappings- Specified by:
getJdbcTypeCount
in interfaceBindable
- Specified by:
getJdbcTypeCount
in interfaceEmbeddableMappingType
- Specified by:
getJdbcTypeCount
in interfaceJdbcMappingContainer
- Specified by:
getJdbcTypeCount
in interfaceSelectableMappings
-
getJdbcMappings
public List<JdbcMapping> getJdbcMappings()
Description copied from interface:Bindable
The list of JDBC mappings- Specified by:
getJdbcMappings
in interfaceBindable
- Specified by:
getJdbcMappings
in interfaceEmbeddableMappingType
- Specified by:
getJdbcMappings
in interfaceJdbcMappingContainer
- Specified by:
getJdbcMappings
in interfaceSelectableMappings
- See Also:
SqlTypedMapping.getJdbcMapping()
-
forEachJdbcType
public int forEachJdbcType(int offset, IndexedConsumer<JdbcMapping> action)
Description copied from interface:JdbcMappingContainer
Visit each JdbcMapping starting from the given offset- Specified by:
forEachJdbcType
in interfaceEmbeddableMappingType
- Specified by:
forEachJdbcType
in interfaceJdbcMappingContainer
-
isCreateEmptyCompositesEnabled
public boolean isCreateEmptyCompositesEnabled()
- Specified by:
isCreateEmptyCompositesEnabled
in interfaceEmbeddableMappingType
-
getNumberOfAttributeMappings
public int getNumberOfAttributeMappings()
Description copied from interface:ManagedMappingType
Get the number of attributes defined on this class and any supers- Specified by:
getNumberOfAttributeMappings
in interfaceManagedMappingType
-
getAttributeMapping
public AttributeMapping getAttributeMapping(int position)
Description copied from interface:ManagedMappingType
Retrieve an attribute by its contributor position- Specified by:
getAttributeMapping
in interfaceManagedMappingType
-
getAttributeMappings
public List<AttributeMapping> getAttributeMappings()
Description copied from interface:ManagedMappingType
Get access to the attributes defined on this class and any supers- Specified by:
getAttributeMappings
in interfaceManagedMappingType
-
visitAttributeMappings
public void visitAttributeMappings(Consumer<? super AttributeMapping> action)
Description copied from interface:ManagedMappingType
Visit attributes defined on this class and any supers- Specified by:
visitAttributeMappings
in interfaceManagedMappingType
-
forEachAttributeMapping
public void forEachAttributeMapping(IndexedConsumer<AttributeMapping> consumer)
Description copied from interface:ManagedMappingType
Visit attributes defined on this class and any supers- Specified by:
forEachAttributeMapping
in interfaceManagedMappingType
-
getNumberOfFetchables
public int getNumberOfFetchables()
Description copied from interface:FetchableContainer
The number of fetchables in the container- Specified by:
getNumberOfFetchables
in interfaceFetchableContainer
-
getFetchable
public Fetchable getFetchable(int position)
- Specified by:
getFetchable
in interfaceFetchableContainer
-
findContainingEntityMapping
public EntityMappingType findContainingEntityMapping()
- Specified by:
findContainingEntityMapping
in interfaceModelPart
-
visitSubParts
public void visitSubParts(Consumer<ModelPart> consumer, EntityMappingType treatTargetType)
Description copied from interface:Queryable
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.- Specified by:
visitSubParts
in interfaceQueryable
-
findSubPart
public ModelPart findSubPart(String name, EntityMappingType treatTargetType)
Description copied from interface:Queryable
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.- Specified by:
findSubPart
in interfaceQueryable
-
createDomainResult
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Create a DomainResult for a specific reference to this ModelPart.- Specified by:
createDomainResult
in interfaceEmbeddableMappingType
- Specified by:
createDomainResult
in interfaceModelPart
-
forEachJdbcValue
public int forEachJdbcValue(Object value, Clause clause, int offset, Bindable.JdbcValuesConsumer valuesConsumer, SharedSessionContractImplementor session)
- Specified by:
forEachJdbcValue
in interfaceBindable
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
disassemble
public Object disassemble(Object value, SharedSessionContractImplementor session)
- Specified by:
disassemble
in 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:
forEachDisassembledJdbcValue
in interfaceBindable
-
createInverseMappingType
public EmbeddableMappingType createInverseMappingType(EmbeddedAttributeMapping valueMapping, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, MappingModelCreationProcess creationProcess)
- Specified by:
createInverseMappingType
in interfaceEmbeddableMappingType
-
-