Package org.hibernate.engine.profile
Class FetchProfile
- java.lang.Object
-
- org.hibernate.engine.profile.FetchProfile
-
- Direct Known Subclasses:
DefaultFetchProfile
public class FetchProfile extends Object
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
Session.enableFetchProfile(String).- See Also:
FetchProfile
-
-
Constructor Summary
Constructors Constructor Description FetchProfile(String name)Constructs aFetchProfilewith the given unique name.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddFetch(Association association, String fetchStyleName)Deprecated, for removal: This API element is subject to removal in a future version.No longer usedvoidaddFetch(Association association, Fetch.Style style)Deprecated, for removal: This API element is subject to removal in a future version.No longer usedvoidaddFetch(Fetch fetch)Add a fetch override to the profile.@Nullable FetchgetFetchByRole(String role)Obtain the fetch override associated with the given role.Map<String,Fetch>getFetches()A map ofFetchinstances, keyed by association roleStringgetName()The name of this fetch profilebooleanhasSubselectLoadableCollectionsEnabled(EntityPersister persister)booleanisContainsJoinFetchedBag()Deprecated, for removal: This API element is subject to removal in a future version.No longer usedbooleanisContainsJoinFetchedCollection()Deprecated, for removal: This API element is subject to removal in a future version.No longer usedStringtoString()
-
-
-
Constructor Detail
-
FetchProfile
public FetchProfile(String name)
Constructs aFetchProfilewith the given unique name. Fetch profile names must be unique within a givenSessionFactory.- Parameters:
name- The name under which we are bound in the sessionFactory
-
-
Method Detail
-
addFetch
@Deprecated(forRemoval=true) public void addFetch(Association association, String fetchStyleName)
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedAdd a fetch override to the profile.- Parameters:
association- The association to be fetchedfetchStyleName- The name of the fetch style to apply
-
addFetch
@Deprecated(forRemoval=true) public void addFetch(Association association, Fetch.Style style)
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedAdd a fetch override to the profile.- Parameters:
association- The association to be fetchedstyle- The style to apply
-
addFetch
@Internal public void addFetch(Fetch fetch)
Add a fetch override to the profile.- Parameters:
fetch- The fetch override to add.
-
getName
public String getName()
The name of this fetch profile
-
getFetches
public Map<String,Fetch> getFetches()
A map ofFetchinstances, keyed by association role
-
getFetchByRole
public @Nullable Fetch getFetchByRole(String role)
Obtain the fetch override associated with the given role.- Parameters:
role- The role name identifying the association- Returns:
- The
Fetch, ornullif there was noFetchfor the given association
-
isContainsJoinFetchedCollection
@Deprecated(forRemoval=true) public boolean isContainsJoinFetchedCollection()
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedDoes this fetch profile contain any collection join fetches?
-
isContainsJoinFetchedBag
@Deprecated(forRemoval=true) public boolean isContainsJoinFetchedBag()
Deprecated, for removal: This API element is subject to removal in a future version.No longer usedDoes this fetch profile contained any bag join fetches?- Returns:
- Value for property 'containsJoinFetchedBag'.
-
hasSubselectLoadableCollectionsEnabled
public boolean hasSubselectLoadableCollectionsEnabled(EntityPersister persister)
-
-