Top Fields Constructors Methods
org.hibernate.metamodel.mapping.internal

public Class EmbeddedAttributeMapping

extends AbstractSingularAttributeMapping
implements EmbeddableValuedFetchable, Fetchable
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.results.graph.Fetchable, org.hibernate.metamodel.mapping.ModelPart, org.hibernate.metamodel.mapping.MappingModelExpressible, org.hibernate.metamodel.mapping.Bindable, org.hibernate.metamodel.mapping.JdbcMappingContainer, org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable, org.hibernate.metamodel.mapping.EmbeddableValuedModelPart, org.hibernate.sql.ast.tree.from.TableGroupJoinProducer, org.hibernate.sql.ast.tree.from.TableGroupProducer, org.hibernate.metamodel.mapping.ModelPartContainer, org.hibernate.sql.results.graph.FetchableContainer, org.hibernate.metamodel.mapping.ValuedModelPart, org.hibernate.metamodel.mapping.SelectableMappings, org.hibernate.metamodel.mapping.ValueMapping, org.hibernate.type.descriptor.java.JavaTypedExpressible
Known Direct Subclasses
org.hibernate.metamodel.mapping.internal.InverseNonAggregatedIdentifierMapping, org.hibernate.metamodel.mapping.internal.VirtualEmbeddedAttributeMapping
Imports
java.util.Collections, .List, java.util.function.BiConsumer, .Consumer, org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.internal.util.collections.CollectionHelper, org.hibernate.metamodel.mapping.AttributeMapping, .AttributeMetadata, .EmbeddableMappingType, .EmbeddableValuedModelPart, .JdbcMapping, .ManagedMappingType, .PropertyBasedMapping, .SelectableMapping, .SelectableMappings, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.property.access.internal.PropertyAccessStrategyBasicImpl, org.hibernate.property.access.spi.PropertyAccess, org.hibernate.query.sqm.sql.SqmToSqlAstConverter, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.Clause, .SqlAstJoinType, org.hibernate.sql.ast.spi.SqlAliasBase, .SqlAstCreationState, .SqlSelection, org.hibernate.sql.ast.tree.expression.ColumnReference, .Expression, .SqlTuple, org.hibernate.sql.ast.tree.from.StandardVirtualTableGroup, .TableGroup, .TableGroupJoin, .TableGroupProducer, .TableReference, org.hibernate.sql.ast.tree.predicate.Predicate, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .Fetch, .FetchParent, .Fetchable, org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable, org.hibernate.sql.results.graph.embeddable.internal.AggregateEmbeddableFetchImpl, .AggregateEmbeddableResultImpl, .EmbeddableFetchImpl, .EmbeddableResultImpl

Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final EmbeddableMappingType
private final PropertyAccess
private final boolean
private final String

Constructor Summary

AccessConstructor and Description
public
EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, String parentInjectionAttributeName, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)

public
EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, PropertyAccess parentInjectionAttributePropertyAccess, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)

pack-priv
EmbeddedAttributeMapping(ManagedMappingType keyDeclaringType, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableValuedModelPart inverseModelPart, EmbeddableMappingType embeddableTypeDescriptor, MappingModelCreationProcess creationProcess)

Method Summary

Modifier and TypeMethod and Description
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public void
applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.
public EmbeddedAttributeMapping
asEmbeddedAttributeMapping()

Overrides default org.hibernate.metamodel.mapping.AttributeMapping.asEmbeddedAttributeMapping.

A utility method to avoid casting explicitly to EmbeddedAttributeMapping
public int
public boolean
public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for a specific reference to this ModelPart.
public TableGroup
createRootTableGroupJoin(NavigablePath
The NavigablePath to the join
navigablePath
,
TableGroup
The join's (L)eft-(H)and (S)ide
lhs
,
String explicitSourceAlias, SqlAliasBase
A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState
explicitSqlAliasBase
,
SqlAstJoinType
An explicit join-type. May be null to signal that the join is for an implicit path.
sqlAstJoinType
,
boolean fetched, Consumer<Predicate>
Consumer for additional predicates from the producer's mapping.
predicateConsumer
,
SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createRootTableGroupJoin.

Create the "join", but return a TableGroup.
public TableGroupJoin
createTableGroupJoin(NavigablePath
The NavigablePath to the join
navigablePath
,
TableGroup
The join's (L)eft-(H)and (S)ide
lhs
,
String explicitSourceAlias, SqlAliasBase
A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState
explicitSqlAliasBase
,
SqlAstJoinType
An explicit join-type. May be null to signal that the join is for an implicit path.
requestedJoinType
,
boolean fetched, boolean
Indicates there are explicit, additional predicates (from an SQM tree ON/WITH clause)
addsPredicate
,
SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createTableGroupJoin.

Create a TableGroupJoin.
public Fetch
generateFetch(FetchParent
The parent of the Fetch we are generating
fetchParent
,
NavigablePath
The overall path within the graph
fetchablePath
,
FetchTiming
The requested fetch timing
fetchTiming
,
boolean selected, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetchable.generateFetch.

Generates a Fetch of this fetchable
public String
getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

The table which contains the columns mapped by this value
public EmbeddableMappingType
public EmbeddableMappingType
public NavigableRole
public PropertyAccess
private static PropertyAccess
getPropertyAccess(String parentInjectionAttributeName, EmbeddableMappingType embeddableMappingType)

public String
getSqlAliasStem()

Implements org.hibernate.sql.ast.tree.from.TableGroupProducer.getSqlAliasStem.

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.

public boolean
public boolean
public SqlTuple
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from org.hibernate.metamodel.mapping.internal.AbstractSingularAttributeMapping:
getGeneratorgetPropertyAccess

Field Detail

embeddableMappingTypeback to summary
private final EmbeddableMappingType embeddableMappingType
parentInjectionAttributePropertyAccessback to summary
private final PropertyAccess parentInjectionAttributePropertyAccess
selectableback to summary
private final boolean selectable
tableExpressionback to summary
private final String tableExpression

Constructor Detail

EmbeddedAttributeMappingback to summary
public EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, String parentInjectionAttributeName, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)
EmbeddedAttributeMappingback to summary
public EmbeddedAttributeMapping(String name, NavigableRole navigableRole, int stateArrayPosition, int fetchableIndex, String tableExpression, AttributeMetadata attributeMetadata, PropertyAccess parentInjectionAttributePropertyAccess, FetchTiming mappedFetchTiming, FetchStyle mappedFetchStyle, EmbeddableMappingType embeddableMappingType, ManagedMappingType declaringType, PropertyAccess propertyAccess)
EmbeddedAttributeMappingback to summary
pack-priv EmbeddedAttributeMapping(ManagedMappingType keyDeclaringType, TableGroupProducer declaringTableGroupProducer, SelectableMappings selectableMappings, EmbeddableValuedModelPart inverseModelPart, EmbeddableMappingType embeddableTypeDescriptor, MappingModelCreationProcess creationProcess)

Method Detail

applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Doc from org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

Annotations
@Override
applySqlSelectionsback to summary
public void applySqlSelections(NavigablePath navigablePath, TableGroup tableGroup, DomainResultCreationState creationState, BiConsumer<SqlSelection, JdbcMapping> selectionConsumer)

Implements org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Doc from org.hibernate.metamodel.mapping.ModelPart.applySqlSelections.

Apply SQL selections for a specific reference to this ModelPart outside the domain query's root select clause.

Annotations
@Override
asEmbeddedAttributeMappingback to summary
public EmbeddedAttributeMapping asEmbeddedAttributeMapping()

Overrides default org.hibernate.metamodel.mapping.AttributeMapping.asEmbeddedAttributeMapping.

Doc from org.hibernate.metamodel.mapping.AttributeMapping.asEmbeddedAttributeMapping.

A utility method to avoid casting explicitly to EmbeddedAttributeMapping

Returns:EmbeddedAttributeMapping

EmbeddedAttributeMapping if this is an instance of EmbeddedAttributeMapping otherwise null

Annotations
@Override
compareback to summary
public int compare(Object value1, Object value2)

Overrides default org.hibernate.metamodel.mapping.AttributeMapping.compare.

Annotations
@Override
containsTableReferenceback to summary
public boolean containsTableReference(String tableExpression)

Overrides default org.hibernate.sql.ast.tree.from.TableGroupProducer.containsTableReference.

Annotations
@Override
createDomainResultback to summary
public <T> DomainResult<T> createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Doc from org.hibernate.metamodel.mapping.ModelPart.createDomainResult.

Create a DomainResult for a specific reference to this ModelPart.

Annotations
@Override
createRootTableGroupJoinback to summary
public TableGroup createRootTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType sqlAstJoinType, boolean fetched, Consumer<Predicate> predicateConsumer, SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createRootTableGroupJoin.

Doc from org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createRootTableGroupJoin.

Create the "join", but return a TableGroup. Intended for creating sub-query correlations. E.g., given

    from SomeEntity e
    where exists (
        select 1
        from AnotherEntity a
        where e.association.attr = 1
    )
We call this for the `e.association` path.
Parameters
navigablePath:NavigablePath

The NavigablePath to the join

lhs:TableGroup

The join's (L)eft-(H)and (S)ide

explicitSqlAliasBase:SqlAliasBase

A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState

sqlAstJoinType:SqlAstJoinType

An explicit join-type. May be null to signal that the join is for an implicit path.

predicateConsumer:Consumer<Predicate>

Consumer for additional predicates from the producer's mapping.

Annotations
@Override
createTableGroupJoinback to summary
public TableGroupJoin createTableGroupJoin(NavigablePath navigablePath, TableGroup lhs, String explicitSourceAlias, SqlAliasBase explicitSqlAliasBase, SqlAstJoinType requestedJoinType, boolean fetched, boolean addsPredicate, SqlAstCreationState creationState)

Implements org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createTableGroupJoin.

Doc from org.hibernate.sql.ast.tree.from.TableGroupJoinProducer.createTableGroupJoin.

Create a TableGroupJoin.

Parameters
navigablePath:NavigablePath

The NavigablePath to the join

lhs:TableGroup

The join's (L)eft-(H)and (S)ide

explicitSqlAliasBase:SqlAliasBase

A specific SqlAliasBase to use. May be null indicating one should be created using the SqlAliasBaseGenerator from creationState

requestedJoinType:SqlAstJoinType

An explicit join-type. May be null to signal that the join is for an implicit path.

addsPredicate:boolean

Indicates there are explicit, additional predicates (from an SQM tree ON/WITH clause)

Annotations
@Override
generateFetchback to summary
public Fetch generateFetch(FetchParent fetchParent, NavigablePath fetchablePath, FetchTiming fetchTiming, boolean selected, String resultVariable, DomainResultCreationState creationState)

Implements org.hibernate.sql.results.graph.Fetchable.generateFetch.

Doc from org.hibernate.sql.results.graph.Fetchable.generateFetch.

Generates a Fetch of this fetchable

Parameters
fetchParent:FetchParent

The parent of the Fetch we are generating

fetchablePath:NavigablePath

The overall path within the graph

fetchTiming:FetchTiming

The requested fetch timing

Annotations
@Override
getContainingTableExpressionback to summary
public String getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

Doc from org.hibernate.metamodel.mapping.ValuedModelPart.getContainingTableExpression.

The table which contains the columns mapped by this value

Annotations
@Override
getEmbeddableTypeDescriptorback to summary
public EmbeddableMappingType getEmbeddableTypeDescriptor()

Implements org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.getEmbeddableTypeDescriptor.

Annotations
@Override
getMappedTypeback to summary
public EmbeddableMappingType getMappedType()

Overrides default org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.getMappedType.

Implements org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Doc from org.hibernate.metamodel.mapping.ValueMapping.getMappedType.

Descriptor for the type of this mapping

Annotations
@Override
getNavigableRoleback to summary
public NavigableRole getNavigableRole()

Implements org.hibernate.metamodel.mapping.ModelPart.getNavigableRole.

Annotations
@Override
getParentInjectionAttributePropertyAccessback to summary
public PropertyAccess getParentInjectionAttributePropertyAccess()

Overrides default org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.getParentInjectionAttributePropertyAccess.

Annotations
@Override
getPropertyAccessback to summary
private static PropertyAccess getPropertyAccess(String parentInjectionAttributeName, EmbeddableMappingType embeddableMappingType)
getSqlAliasStemback to summary
public String getSqlAliasStem()

Implements org.hibernate.sql.ast.tree.from.TableGroupProducer.getSqlAliasStem.

Doc from org.hibernate.sql.ast.tree.from.TableGroupProducer.getSqlAliasStem.

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.

Annotations
@Override
isEmbeddedAttributeMappingback to summary
public boolean isEmbeddedAttributeMapping()

Overrides default org.hibernate.metamodel.mapping.AttributeMapping.isEmbeddedAttributeMapping.

Annotations
@Override
isSelectableback to summary
public boolean isSelectable()

Overrides default org.hibernate.sql.results.graph.Fetchable.isSelectable.

Annotations
@Override
toSqlExpressionback to summary
public SqlTuple toSqlExpression(TableGroup tableGroup, Clause clause, SqmToSqlAstConverter walker, SqlAstCreationState sqlAstCreationState)

Implements org.hibernate.metamodel.mapping.EmbeddableValuedModelPart.toSqlExpression.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override