类 FetchProfile
- java.lang.Object
-
- org.hibernate.engine.profile.FetchProfile
-
public class FetchProfile extends Object
A 'fetch profile' allows a user to dynamically modify the fetching strategy used for particular associations at runtime, whereas that information was historically only statically defined in the metadata. This class defines the runtime representation of this data.- 作者:
- Steve Ebersole
-
-
构造器概要
构造器 构造器 说明 FetchProfile(String name)Constructs a FetchProfile, supplying its unique name (unique within the SessionFactory).
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 voidaddFetch(Association association, String fetchStyleName)Add a fetch to the profile.voidaddFetch(Association association, Fetch.Style style)Add a fetch to the profile.voidaddFetch(Fetch fetch)Add a fetch to the profile.FetchgetFetchByRole(String role)Obtain the fetch associated with the given role.Map<String,Fetch>getFetches()Getter for property 'fetches'.StringgetName()Getter for property 'name'.booleanisContainsJoinFetchedBag()Getter for property 'containsJoinFetchedBag', which flags whether this fetch profile contained any bag join fetchesbooleanisContainsJoinFetchedCollection()Getter for property 'containsJoinFetchedCollection', which flags whether this fetch profile contained any collection join fetches.
-
-
-
构造器详细资料
-
FetchProfile
public FetchProfile(String name)
Constructs a FetchProfile, supplying its unique name (unique within the SessionFactory).- 参数:
name- The name under which we are bound in the sessionFactory
-
-
方法详细资料
-
addFetch
public void addFetch(Association association, String fetchStyleName)
Add a fetch to the profile.- 参数:
association- The association to be fetchedfetchStyleName- The name of the fetch style to apply
-
addFetch
public void addFetch(Association association, Fetch.Style style)
Add a fetch to the profile.- 参数:
association- The association to be fetchedstyle- The style to apply
-
addFetch
public void addFetch(Fetch fetch)
Add a fetch to the profile.- 参数:
fetch- The fetch to add.
-
getName
public String getName()
Getter for property 'name'.- 返回:
- Value for property 'name'.
-
getFetches
public Map<String,Fetch> getFetches()
Getter for property 'fetches'. Map ofFetchinstances, keyed by association role- 返回:
- Value for property 'fetches'.
-
getFetchByRole
public Fetch getFetchByRole(String role)
Obtain the fetch associated with the given role.- 参数:
role- The role identifying the fetch- 返回:
- The fetch, or
nullif a matching one was not found
-
isContainsJoinFetchedCollection
public boolean isContainsJoinFetchedCollection()
Getter for property 'containsJoinFetchedCollection', which flags whether this fetch profile contained any collection join fetches.- 返回:
- Value for property 'containsJoinFetchedCollection'.
-
isContainsJoinFetchedBag
public boolean isContainsJoinFetchedBag()
Getter for property 'containsJoinFetchedBag', which flags whether this fetch profile contained any bag join fetches- 返回:
- Value for property 'containsJoinFetchedBag'.
-
-