Package org.hibernate.engine.profile
Class FetchProfile
java.lang.Object
org.hibernate.engine.profile.FetchProfile
- Direct Known Subclasses:
DefaultFetchProfile
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:
-
Constructor Summary
ConstructorsConstructorDescriptionFetchProfile(String name) Constructs aFetchProfilewith the given unique name. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a fetch override to the profile.@Nullable FetchgetFetchByRole(String role) Obtain the fetch override associated with the given role.A map ofFetchinstances, keyed by association rolegetName()The name of this fetch profilebooleantoString()
-
Constructor Details
-
FetchProfile
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 Details
-
addFetch
Add a fetch override to the profile.- Parameters:
fetch- The fetch override to add.
-
getName
The name of this fetch profile -
getFetches
A map ofFetchinstances, keyed by association role -
getFetchByRole
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
-
toString
-
hasSubselectLoadableCollectionsEnabled
-