Top Description Methods
org.hibernate.sql.results.graph

public Interface Fetchable

extends ModelPart
Known Direct Subinterfaces
org.hibernate.sql.results.graph.embeddable.EmbeddableValuedFetchable, org.hibernate.sql.results.graph.entity.EntityValuedFetchable, org.hibernate.metamodel.mapping.Association, org.hibernate.metamodel.mapping.AttributeMapping, org.hibernate.metamodel.mapping.BasicValuedModelPart, org.hibernate.metamodel.mapping.CollectionPart, org.hibernate.metamodel.mapping.DiscriminatedAssociationModelPart, org.hibernate.metamodel.mapping.DiscriminatorMapping, org.hibernate.metamodel.mapping.EmbeddableValuedModelPart, org.hibernate.sql.results.graph.DatabaseSnapshotContributor
Known Direct Implementers
org.hibernate.metamodel.mapping.internal.EmbeddedAttributeMapping
Annotations
@Incubating
Imports
org.hibernate.Incubating, org.hibernate.engine.FetchTiming, org.hibernate.internal.util.IndexedConsumer, org.hibernate.metamodel.mapping.AttributeMapping, .EntityMappingType, .ModelPart, org.hibernate.metamodel.model.domain.NavigableRole, org.hibernate.spi.NavigablePath

Parts of the domain model that can be fetched. In other words, a ModelPart which can produce Fetch references.
Author
Steve Ebersole

Method Summary

Modifier and TypeMethod and Description
public default AttributeMapping
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)

Generates a Fetch of this fetchable

public int
getFetchableKey()

The key that identifies this Fetchable within a FetchableContainer.

public String
getFetchableName()

The name of the fetchable.

public FetchOptions
getMappedFetchOptions()

The configured fetch timing and style

public default boolean
incrementFetchDepth()

Should this Fetchable affect the fetch depth?

public default boolean
public default Fetch

Returns:

The Fetch representing the circularity; null indicates the fetch is not circular
resolveCircularFetch
(NavigablePath
The overall path within the graph
fetchablePath
,
FetchParent fetchParent, FetchTiming fetchTiming, DomainResultCreationState creationState)

Check whether this Fetchable is considered a circular fetch.

Inherited from org.hibernate.metamodel.mapping.ModelPart:
applySqlSelectionsapplySqlSelectionsareEqualasEntityMappingTypebreakDownJdbcValuesbreakDownJdbcValuescreateDomainResultdecomposedecomposefindContainingEntityMappingforEachSelectableforEachSelectablegetJavaTypegetNavigableRolegetPartMappingTypegetPartNamehasPartitionedSelectionMappingisEntityIdentifierMappingisVirtual

Method Detail

asAttributeMappingback to summary
public default AttributeMapping asAttributeMapping()

Overrides default org.hibernate.metamodel.mapping.ModelPart.asAttributeMapping.

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

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

getFetchableKeyback to summary
public int 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.

getFetchableNameback to summary
public String getFetchableName()

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

See Also
getNavigableRole(), NavigableRole#getLocalName()
getMappedFetchOptionsback to summary
public FetchOptions getMappedFetchOptions()

The configured fetch timing and style

incrementFetchDepthback to summary
public default boolean incrementFetchDepth()

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

See Also
org.hibernate.cfg.AvailableSettings#MAX_FETCH_DEPTH
isSelectableback to summary
public default boolean isSelectable()
resolveCircularFetchback to summary
public default Fetch resolveCircularFetch(NavigablePath fetchablePath, FetchParent fetchParent, FetchTiming fetchTiming, DomainResultCreationState creationState)

Check whether this Fetchable is considered a circular fetch.

Parameters
fetchablePath:NavigablePath

The overall path within the graph

Returns:Fetch

The Fetch representing the circularity; null indicates the fetch is not circular