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

public abstract Class AbstractEntityCollectionPart

extends Object
implements EntityCollectionPart, FetchOptions, TableGroupProducer
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.ast.tree.from.TableGroupProducer, org.hibernate.metamodel.mapping.ModelPartContainer, 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.FetchOptions, org.hibernate.sql.results.graph.FetchStyleAccess, org.hibernate.sql.results.graph.FetchTimingAccess, org.hibernate.metamodel.mapping.internal.EntityCollectionPart, org.hibernate.sql.results.graph.entity.EntityValuedFetchable, org.hibernate.metamodel.mapping.EntityValuedModelPart, org.hibernate.sql.results.graph.FetchableContainer, org.hibernate.sql.results.graph.Fetchable, org.hibernate.metamodel.mapping.CollectionPart, org.hibernate.type.descriptor.java.JavaTypedExpressible, org.hibernate.metamodel.mapping.ValuedModelPart, org.hibernate.metamodel.mapping.SelectableMappings, org.hibernate.metamodel.mapping.ValueMapping
Known Direct Subclasses
org.hibernate.metamodel.mapping.internal.ManyToManyCollectionPart, org.hibernate.metamodel.mapping.internal.OneToManyCollectionPart
Imports
java.util.HashSet, .Set, org.hibernate.annotations.NotFoundAction, org.hibernate.engine.FetchStyle, .FetchTiming, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.util.StringHelper, org.hibernate.mapping.Collection, .IndexedCollection, .OneToMany, .PersistentClass, .ToOne, .Value, org.hibernate.metamodel.mapping.AssociationKey, .EntityIdentifierMapping, .EntityMappingType, .PluralAttributeMapping, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.persister.collection.CollectionPersister, org.hibernate.persister.collection.mutation.CollectionMutationTarget, org.hibernate.persister.entity.PropertyMapping, org.hibernate.spi.NavigablePath, org.hibernate.sql.ast.spi.FromClauseAccess, .SqlAliasBase, .SqlAstCreationContext, .SqlAstCreationState, org.hibernate.sql.ast.tree.from.PluralTableGroup, .StandardTableGroup, .TableGroup, .TableGroupProducer, .TableReference, org.hibernate.sql.results.graph.DomainResult, .DomainResultCreationState, .FetchOptions, .FetchParent, org.hibernate.sql.results.graph.collection.internal.EagerCollectionFetch, org.hibernate.sql.results.graph.entity.EntityFetch, org.hibernate.sql.results.graph.entity.internal.EntityFetchJoinedImpl, org.hibernate.type.CompositeType, .Type

Base support for EntityCollectionPart implementations
Author
Steve Ebersole

Field Summary

Modifier and TypeField and Description
private final EntityMappingType
private final CollectionPersister
private final CollectionPart.Nature
private final NotFoundAction
private final Set<String>

Constructor Summary

AccessConstructor and Description
public
AbstractEntityCollectionPart(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityTypeDescriptor, NotFoundAction notFoundAction, MappingModelCreationProcess creationProcess)

protected

Method Summary

Modifier and TypeMethod and Description
protected EagerCollectionFetch
buildEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, TableGroup collectionTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)

For Hibernate Reactive

protected EntityFetch
buildEntityFetchJoined(FetchParent fetchParent, AbstractEntityCollectionPart abstractEntityCollectionPart, TableGroup partTableGroup, NavigablePath fetchablePath, DomainResultCreationState creationState)

For Hibernate Reactive

public boolean
public <T> DomainResult<T>
createDomainResult(NavigablePath navigablePath, TableGroup tableGroup, String resultVariable, DomainResultCreationState creationState)

Overrides default org.hibernate.metamodel.mapping.EntityValuedModelPart.createDomainResult.

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

Create a DomainResult for a specific reference to this ModelPart.
public TableGroup
createTableGroupInternal(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, final SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)

public Object
public EntityMappingType
public EntityFetch
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, org.hibernate.sql.results.graph.entity.EntityValuedFetchable.generateFetch.

Generates a Fetch of this fetchable
public EntityMappingType
public CollectionPersister
public int
public String
public FetchOptions
public EntityMappingType
getMappedType()

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

Descriptor for the type of this mapping
public CollectionPart.Nature
public NavigableRole
public NotFoundAction
public int
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 FetchStyle
protected Set<String>
public FetchTiming
public boolean
incrementFetchDepth()

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

Should this Fetchable affect the fetch depth?
public boolean
public boolean
protected abstract AssociationKey
private TableGroup
resolveIndexTableGroup(PluralTableGroup collectionTableGroup, NavigablePath fetchablePath, FromClauseAccess fromClauseAccess, DomainResultCreationState creationState)

private TableGroup
private static Set<String>
resolveTargetKeyPropertyNames(CollectionPart.Nature nature, CollectionPersister collectionDescriptor, Collection collectionBootDescriptor, EntityMappingType elementTypeDescriptor, MappingModelCreationProcess creationProcess)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

associatedEntityTypeDescriptorback to summary
private final EntityMappingType associatedEntityTypeDescriptor
collectionDescriptorback to summary
private final CollectionPersister collectionDescriptor
natureback to summary
private final CollectionPart.Nature nature
notFoundActionback to summary
private final NotFoundAction notFoundAction
targetKeyPropertyNamesback to summary
private final Set<String> targetKeyPropertyNames

Constructor Detail

AbstractEntityCollectionPartback to summary
public AbstractEntityCollectionPart(CollectionPart.Nature nature, Collection collectionBootDescriptor, CollectionPersister collectionDescriptor, EntityMappingType associatedEntityTypeDescriptor, NotFoundAction notFoundAction, MappingModelCreationProcess creationProcess)
AbstractEntityCollectionPartback to summary
protected AbstractEntityCollectionPart(AbstractEntityCollectionPart original)

For Hibernate Reactive

Method Detail

buildEagerCollectionFetchback to summary
protected EagerCollectionFetch buildEagerCollectionFetch(NavigablePath fetchedPath, PluralAttributeMapping fetchedAttribute, TableGroup collectionTableGroup, FetchParent fetchParent, DomainResultCreationState creationState)

For Hibernate Reactive

buildEntityFetchJoinedback to summary
protected EntityFetch buildEntityFetchJoined(FetchParent fetchParent, AbstractEntityCollectionPart abstractEntityCollectionPart, TableGroup partTableGroup, NavigablePath fetchablePath, DomainResultCreationState creationState)

For Hibernate Reactive

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)

Overrides default org.hibernate.metamodel.mapping.EntityValuedModelPart.createDomainResult.

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
createTableGroupInternalback to summary
public TableGroup createTableGroupInternal(boolean canUseInnerJoins, NavigablePath navigablePath, boolean fetched, String sourceAlias, final SqlAliasBase sqlAliasBase, SqlAstCreationState creationState)
disassembleback to summary
public Object disassemble(Object value, SharedSessionContractImplementor session)

Overrides default org.hibernate.metamodel.mapping.EntityValuedModelPart.disassemble.

Implements org.hibernate.metamodel.mapping.Bindable.disassemble.

Doc from org.hibernate.metamodel.mapping.Bindable.disassemble.

Breaks down a value of J into its simple pieces. E.g., an embedded value gets broken down into an array of its attribute state; a basic value converts to itself; etc.

Generally speaking, this is the form in which entity state is kept relative to a Session via EntityEntry.

@Entity class Person {
    @Id Integer id;
    @Embedded Name name;
    int age;
}

@Embeddable class Name {
    String familiarName;
    String familyName;
}

At the top level, we would want to disassemble a Person value, so we'd ask the Bindable for the Person entity to disassemble. Given a Person value:

Person( id=1, name=Name( 'Steve', 'Ebersole' ), 28 )

this disassemble would result in a multidimensional array:

[ ["Steve", "Ebersole"], 28 ]

Note that the identifier is not part of this disassembled state. Note also how the embedded value results in a sub-array.

Annotations
@Override
findContainingEntityMappingback to summary
public EntityMappingType findContainingEntityMapping()

Implements org.hibernate.metamodel.mapping.ModelPart.findContainingEntityMapping.

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

Implements org.hibernate.sql.results.graph.Fetchable.generateFetch, org.hibernate.sql.results.graph.entity.EntityValuedFetchable.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
getAssociatedEntityMappingTypeback to summary
public EntityMappingType getAssociatedEntityMappingType()

Implements org.hibernate.metamodel.mapping.internal.EntityCollectionPart.getAssociatedEntityMappingType.

Annotations
@Override
getCollectionDescriptorback to summary
public CollectionPersister getCollectionDescriptor()
getFetchableKeyback to summary
public int getFetchableKey()

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

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

The key that identifies this Fetchable within a FetchableContainer. If this Fetchable is part of FetchableContainer#visitFetchables(IndexedConsumer, EntityMappingType), the values is guaranteed to be between 0 (inclusive) and FetchableContainer#getNumberOfFetchableKeys() (exclusive). Other Fetchable objects may have a special negative value.

The main intent of this key is to index e.g. Fetch objects in an array.

Annotations
@Override
getFetchableNameback to summary
public String getFetchableName()

Overrides default org.hibernate.metamodel.mapping.internal.EntityCollectionPart.getFetchableName.

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

The name of the fetchable. This is the part's "local name".

Annotations
@Override
getMappedFetchOptionsback to summary
public FetchOptions getMappedFetchOptions()

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

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

The configured fetch timing and style

Annotations
@Override
getMappedTypeback to summary
public EntityMappingType 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
getNatureback to summary
public CollectionPart.Nature getNature()

Implements org.hibernate.metamodel.mapping.CollectionPart.getNature.

Annotations
@Override
getNavigableRoleback to summary
public NavigableRole getNavigableRole()

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

Annotations
@Override
getNotFoundActionback to summary
public NotFoundAction getNotFoundAction()

Implements org.hibernate.metamodel.mapping.internal.EntityCollectionPart.getNotFoundAction.

Annotations
@Override
getNumberOfFetchablesback to summary
public int getNumberOfFetchables()

Implements org.hibernate.sql.results.graph.FetchableContainer.getNumberOfFetchables.

Doc from org.hibernate.sql.results.graph.FetchableContainer.getNumberOfFetchables.

The number of fetchables in the container

Annotations
@Override
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
getStyleback to summary
public FetchStyle getStyle()

Implements org.hibernate.sql.results.graph.FetchStyleAccess.getStyle.

Annotations
@Override
getTargetKeyPropertyNamesback to summary
protected Set<String> getTargetKeyPropertyNames()
getTimingback to summary
public FetchTiming getTiming()

Implements org.hibernate.sql.results.graph.FetchTimingAccess.getTiming.

Annotations
@Override
incrementFetchDepthback to summary
public boolean incrementFetchDepth()

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

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

Should this Fetchable affect the fetch depth? E.g., composites would generally not increment the fetch depth.

Annotations
@Override
isOptionalback to summary
public boolean isOptional()

Implements org.hibernate.sql.results.graph.entity.EntityValuedFetchable.isOptional.

Annotations
@Override
isUnwrapProxyback to summary
public boolean isUnwrapProxy()

Implements org.hibernate.sql.results.graph.entity.EntityValuedFetchable.isUnwrapProxy.

Annotations
@Override
resolveFetchAssociationKeyback to summary
protected abstract AssociationKey resolveFetchAssociationKey()
resolveIndexTableGroupback to summary
private TableGroup resolveIndexTableGroup(PluralTableGroup collectionTableGroup, NavigablePath fetchablePath, FromClauseAccess fromClauseAccess, DomainResultCreationState creationState)
resolveTableGroupback to summary
private TableGroup resolveTableGroup(NavigablePath fetchablePath, DomainResultCreationState creationState)
resolveTargetKeyPropertyNamesback to summary
private static Set<String> resolveTargetKeyPropertyNames(CollectionPart.Nature nature, CollectionPersister collectionDescriptor, Collection collectionBootDescriptor, EntityMappingType elementTypeDescriptor, MappingModelCreationProcess creationProcess)
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