Top Description Fields Constructors Methods
org.hibernate.engine.profile

public Class FetchProfile

extends Object
Class Inheritance
Known Direct Subclasses
org.hibernate.engine.profile.DefaultFetchProfile
Imports
java.util.HashMap, .Map, org.hibernate.Internal, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.persister.entity.EntityPersister, org.hibernate.type.BagType, .Type, org.checkerframework.checker.nullness.qual.Nullable

The runtime representation of a Hibernate fetch profile defined in annotations.

Fetch profiles compete with JPA-defined named entity graphs. The semantics of these two facilities are not identical, however, since a fetch profile is a list, not a graph, and is not by nature rooted at any one particular entity. Instead, given a root entity as input, an active fetch profile contributes to the determination of the fetch graph.

A named fetch profile may be enabled in a given session by calling org.hibernate.Session#enableFetchProfile(String).

Author
Steve Ebersole
See Also
org.hibernate.mapping.FetchProfile

Field Summary

Modifier and TypeField and Description
private @Nullable Fetch
private boolean
private boolean
private final Map<String, Fetch>
private static final CoreMessageLogger
private final String

Constructor Summary

AccessConstructor and Description
public
FetchProfile(String
The name under which we are bound in the sessionFactory
name
)

Constructs a FetchProfile with the given unique name.

Method Summary

Modifier and TypeMethod and Description
public void
addFetch(Association
The association to be fetched
association
,
String
The name of the fetch style to apply
fetchStyleName
)

Deprecated for removal. No longer used
Add a fetch override to the profile.
public void
addFetch(Association
The association to be fetched
association
,
Fetch.Style
The style to apply
style
)

Deprecated for removal. No longer used
Add a fetch override to the profile.
public void
addFetch(final Fetch
The fetch override to add.
fetch
)

Add a fetch override to the profile.

public @Nullable Fetch

Returns:

The Fetch, or null if there was no Fetch for the given association
getFetchByRole
(String
The role name identifying the association
role
)

Obtain the fetch override associated with the given role.

public Map<String, Fetch>
getFetches()

A map of Fetch instances, keyed by association role

public String
getName()

The name of this fetch profile

public boolean
public boolean

Returns:

Value for property 'containsJoinFetchedBag'.
isContainsJoinFetchedBag
()

Deprecated for removal. No longer used
Does this fetch profile contained any bag join fetches?
public boolean
isContainsJoinFetchedCollection()

Deprecated for removal. No longer used
Does this fetch profile contain any collection join fetches?
public String
toString()

Overrides java.lang.Object.toString.

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

Field Detail

bagJoinFetchback to summary
private @Nullable Fetch bagJoinFetch
containsJoinFetchedBagback to summary
private boolean containsJoinFetchedBag
containsJoinFetchedCollectionback to summary
private boolean containsJoinFetchedCollection
fetchesback to summary
private final Map<String, Fetch> fetches
LOGback to summary
private static final CoreMessageLogger LOG
nameback to summary
private final String name

Constructor Detail

FetchProfileback to summary
public FetchProfile(String name)

Constructs a FetchProfile with the given unique name. Fetch profile names must be unique within a given SessionFactory.

Parameters
name:String

The name under which we are bound in the sessionFactory

Method Detail

addFetchback to summary
public void addFetch(Association association, String fetchStyleName)

Deprecated

for removal.

No longer used

Add a fetch override to the profile.

Parameters
association:Association

The association to be fetched

fetchStyleName:String

The name of the fetch style to apply

Annotations
@Deprecated
forRemoval:true
addFetchback to summary
public void addFetch(Association association, Fetch.Style style)

Deprecated

for removal.

No longer used

Add a fetch override to the profile.

Parameters
association:Association

The association to be fetched

style:Fetch.Style

The style to apply

Annotations
@Deprecated
forRemoval:true
addFetchback to summary
public void addFetch(final Fetch fetch)

Add a fetch override to the profile.

Parameters
fetch:Fetch

The fetch override to add.

Annotations
@Internal
getFetchByRoleback to summary
public @Nullable Fetch getFetchByRole(String role)

Obtain the fetch override associated with the given role.

Parameters
role:String

The role name identifying the association

Returns:@Nullable Fetch

The Fetch, or null if there was no Fetch for the given association

getFetchesback to summary
public Map<String, Fetch> getFetches()

A map of Fetch instances, keyed by association role

getNameback to summary
public String getName()

The name of this fetch profile

hasSubselectLoadableCollectionsEnabledback to summary
public boolean hasSubselectLoadableCollectionsEnabled(EntityPersister persister)
isContainsJoinFetchedBagback to summary
public boolean isContainsJoinFetchedBag()

Deprecated

for removal.

No longer used

Does this fetch profile contained any bag join fetches?

Returns:boolean

Value for property 'containsJoinFetchedBag'.

Annotations
@Deprecated
forRemoval:true
isContainsJoinFetchedCollectionback to summary
public boolean isContainsJoinFetchedCollection()

Deprecated

for removal.

No longer used

Does this fetch profile contain any collection join fetches?

Annotations
@Deprecated
forRemoval:true
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