Class EmbeddedAttributeMapping
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
-
- org.hibernate.metamodel.mapping.internal.AbstractStateArrayContributorMapping
-
- org.hibernate.metamodel.mapping.internal.AbstractSingularAttributeMapping
-
- org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping
-
- All Implemented Interfaces:
AttributeMapping
,Bindable
,EmbeddableValuedModelPart
,JdbcMappingContainer
,MappingModelExpressible
,ModelPart
,ModelPartContainer
,PropertyBasedMapping
,Queryable
,SingularAttributeMapping
,ValueMapping
,TableGroupJoinProducer
,TableGroupProducer
,DatabaseSnapshotContributor
,EmbeddableValuedFetchable
,Fetchable
,FetchableContainer
,FetchOptions
,FetchStyleAccess
,FetchTimingAccess
,JavaTypedExpressible
,MutabilityPlanExposer
- Direct Known Subclasses:
InverseNonAggregatedIdentifierMapping
,VirtualEmbeddedAttributeMapping
public class EmbeddedAttributeMapping extends AbstractSingularAttributeMapping implements EmbeddableValuedFetchable, Fetchable
-
-
Nested Class Summary
-
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 EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, String tableExpression, AttributeMetadataAccess attributeMetadataAccess, String parentInjectionAttributeName, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess, ValueGeneration valueGeneration)
EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, String tableExpression, AttributeMetadataAccess attributeMetadataAccess, PropertyAccess parentInjectionAttributePropertyAccess, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess, ValueGeneration valueGeneration)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.EmbeddedAttributeMapping
asEmbeddedAttributeMapping()
A utility method to avoid casting explicitly to EmbeddedAttributeMappingvoid
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.TableGroup
createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)
Create a TableGroupJoin as defined for this producer, but as root TableGroup.TableGroupJoin
createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)
Create a TableGroupJoin as defined for this producer The sqlAstJoinType may be null to signal that the join is for an implicit path.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.int
forEachSelectable(int offset, SelectableConsumer consumer)
Fetch
generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Generates a Fetch of this fetchableString
getContainingTableExpression()
The main table expression (table name or subselect) that usually contains most of the columns to which this embedded is mapped.EmbeddableMappingType
getEmbeddableTypeDescriptor()
Fetchable
getFetchable(int position)
EmbeddableMappingType
getMappedType()
Descriptor for the type of this mappingNavigableRole
getNavigableRole()
int
getNumberOfFetchables()
The number of fetchables in the containerPropertyAccess
getParentInjectionAttributePropertyAccess()
String
getSqlAliasStem()
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generatedboolean
isEmbeddedAttributeMapping()
SqlTuple
toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
String
toString()
void
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.AbstractSingularAttributeMapping
getPropertyAccess, getValueGeneration
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractStateArrayContributorMapping
getAttributeMetadataAccess, getFetchableName, getMappedFetchOptions, getStateArrayPosition, getStyle, getTiming
-
Methods inherited from class org.hibernate.metamodel.mapping.internal.AbstractAttributeMapping
getAttributeName, getDeclaringType, getJavaType, getPartMappingType
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.metamodel.mapping.AttributeMapping
asAttributeMapping, asPluralAttributeMapping, findContainingEntityMapping, getAttributeMetadataAccess, getAttributeName, getDeclaringType, getExposedMutabilityPlan, getPartName, getStateArrayPosition, getValue, isPluralAttributeMapping, setValue
-
Methods inherited from interface org.hibernate.metamodel.mapping.Bindable
forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue
-
Methods inherited from interface org.hibernate.sql.results.graph.DatabaseSnapshotContributor
createSnapshotDomainResult
-
Methods inherited from interface org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable
getDefaultSqlAstJoinType, isSimpleJoinPredicate
-
Methods inherited from interface org.hibernate.metamodel.mapping.EmbeddableValuedModelPart
disassemble, forEachDisassembledJdbcValue, forEachJdbcType, forEachJdbcValue, getJdbcMappings, getJdbcTypeCount
-
Methods inherited from interface org.hibernate.sql.results.graph.Fetchable
getFetchableName, getMappedFetchOptions, incrementFetchDepth, resolveCircularFetch
-
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.ModelPart
areEqual, forEachSelectable, getJavaType, getPartMappingType
-
Methods inherited from interface org.hibernate.metamodel.mapping.Queryable
findByPath, findSubTypesSubPart, resolveSubPart
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupJoinProducer
createRootTableGroupJoin, createTableGroupJoin
-
Methods inherited from interface org.hibernate.sql.ast.tree.from.TableGroupProducer
containsTableReference
-
Methods inherited from interface org.hibernate.metamodel.mapping.ValueMapping
getExpressibleJavaType, treatAs
-
-
-
-
Constructor Detail
-
EmbeddedAttributeMapping
public EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, String tableExpression, AttributeMetadataAccess attributeMetadataAccess, String parentInjectionAttributeName, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess, ValueGeneration valueGeneration)
-
EmbeddedAttributeMapping
public EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, String tableExpression, AttributeMetadataAccess attributeMetadataAccess, PropertyAccess parentInjectionAttributePropertyAccess, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess, ValueGeneration valueGeneration)
-
-
Method Detail
-
getMappedType
public EmbeddableMappingType getMappedType()
Description copied from interface:ValueMapping
Descriptor for the type of this mapping- Specified by:
getMappedType
in interfaceValueMapping
-
getEmbeddableTypeDescriptor
public EmbeddableMappingType getEmbeddableTypeDescriptor()
- Specified by:
getEmbeddableTypeDescriptor
in interfaceEmbeddableValuedModelPart
-
getContainingTableExpression
public String getContainingTableExpression()
Description copied from interface:EmbeddableValuedModelPart
The main table expression (table name or subselect) that usually contains most of the columns to which this embedded is mapped.- Specified by:
getContainingTableExpression
in interfaceEmbeddableValuedModelPart
-
getParentInjectionAttributePropertyAccess
public PropertyAccess getParentInjectionAttributePropertyAccess()
- Specified by:
getParentInjectionAttributePropertyAccess
in interfaceEmbeddableValuedModelPart
- See Also:
Parent
-
forEachSelectable
public int forEachSelectable(int offset, SelectableConsumer consumer)
- Specified by:
forEachSelectable
in interfaceEmbeddableValuedModelPart
- Specified by:
forEachSelectable
in interfaceModelPart
-
breakDownJdbcValues
public void breakDownJdbcValues(Object domainValue, ModelPart.JdbcValueConsumer valueConsumer, SharedSessionContractImplementor session)
- Specified by:
breakDownJdbcValues
in interfaceModelPart
-
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 interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
-
applySqlSelections
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection,JdbcMapping> selectionConsumer)
Description copied from interface:ModelPart
Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.- Specified by:
applySqlSelections
in interfaceModelPart
-
getNavigableRole
public NavigableRole getNavigableRole()
- Specified by:
getNavigableRole
in interfaceModelPart
- See Also:
ModelPart.getPartName()
-
generateFetch
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)
Description copied from interface:Fetchable
Generates a Fetch of this fetchable- Specified by:
generateFetch
in interfaceFetchable
- Parameters:
fetchParent
- The parent of the Fetch we are generatingfetchablePath
- The overall path within the graphfetchTiming
- The requested fetch timing
-
toSqlExpression
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)
- Specified by:
toSqlExpression
in interfaceEmbeddableValuedModelPart
-
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
-
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
-
createTableGroupJoin
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)
Description copied from interface:TableGroupJoinProducer
Create a TableGroupJoin as defined for this producer The sqlAstJoinType may be null to signal that the join is for an implicit path. When addsPredicate istrue
, the SQM join for the attribute contains an explicitON
clause, and isfalse
otherwise.- Specified by:
createTableGroupJoin
in interfaceTableGroupJoinProducer
-
createRootTableGroupJoin
public TableGroup createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAstJoinType requestedJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAliasBaseGenerator aliasBaseGenerator, SqlExpressionResolver sqlExpressionResolver, FromClauseAccess fromClauseAccess, SqlAstCreationContext creationContext)
Description copied from interface:TableGroupJoinProducer
Create a TableGroupJoin as defined for this producer, but as root TableGroup. The main purpose of this is for correlating an association in a subquery i.e. `... alias where exists (select 1 from SomeEntity e where alias.association.attr = 1)`. The sqlAstJoinType may be null to signal that the join is for an implicit path.- Specified by:
createRootTableGroupJoin
in interfaceTableGroupJoinProducer
-
getSqlAliasStem
public String getSqlAliasStem()
Description copied from interface:TableGroupProducer
Get the "stem" used as the base for generating SQL table aliases for table references that are part of the TableGroup being generated Note that this is a metadata-ive value. It is only ever used internal to the producer producing its TableGroup.- Specified by:
getSqlAliasStem
in interfaceTableGroupProducer
- See Also:
SqlAliasBaseManager.createSqlAliasBase(java.lang.String)
-
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
-
asEmbeddedAttributeMapping
public EmbeddedAttributeMapping asEmbeddedAttributeMapping()
Description copied from interface:AttributeMapping
A utility method to avoid casting explicitly to EmbeddedAttributeMapping- Specified by:
asEmbeddedAttributeMapping
in interfaceAttributeMapping
- Returns:
- EmbeddedAttributeMapping if this is an instance of EmbeddedAttributeMapping otherwise
null
-
isEmbeddedAttributeMapping
public boolean isEmbeddedAttributeMapping()
- Specified by:
isEmbeddedAttributeMapping
in interfaceAttributeMapping
-
-