org.hibernate.engine.profile
Class FetchProfile

java.lang.Object
  extended by 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.

Author:
Steve Ebersole

Constructor Summary
FetchProfile(String name)
          A 'fetch profile' is uniquely named within a SessionFactory, thus it is also uniquely and easily identifiable within that SessionFactory.
 
Method Summary
 void addFetch(Association association, Fetch.Style style)
          Add a fetch to the profile.
 void addFetch(Association association, String fetchStyleName)
          Add a fetch to the profile.
 void addFetch(Fetch fetch)
          Add a fetch to the profile.
 Fetch getFetchByRole(String role)
           
 Map<String,Fetch> getFetches()
          Getter for property 'fetches'.
 String getName()
          Getter for property 'name'.
 boolean isContainsJoinFetchedBag()
          Getter for property 'containsJoinFetchedBag', which flags whether this fetch profile contained any bag join fetches
 boolean isContainsJoinFetchedCollection()
          Getter for property 'containsJoinFetchedCollection', which flags whether this fetch profile contained any collection join fetches.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FetchProfile

public FetchProfile(String name)
A 'fetch profile' is uniquely named within a SessionFactory, thus it is also uniquely and easily identifiable within that SessionFactory.

Parameters:
name - The name under which we are bound in the sessionFactory
Method Detail

addFetch

public void addFetch(Association association,
                     String fetchStyleName)
Add a fetch to the profile.

Parameters:
association - The association to be fetched
fetchStyleName - The name of the fetch style to apply

addFetch

public void addFetch(Association association,
                     Fetch.Style style)
Add a fetch to the profile.

Parameters:
association - The association to be fetched
style - The style to apply

addFetch

public void addFetch(Fetch fetch)
Add a fetch to the profile.

Parameters:
fetch - The fetch to add.

getName

public String getName()
Getter for property 'name'.

Returns:
Value for property 'name'.

getFetches

public Map<String,Fetch> getFetches()
Getter for property 'fetches'. Map of Fetch instances, keyed by association role

Returns:
Value for property 'fetches'.

getFetchByRole

public Fetch getFetchByRole(String role)

isContainsJoinFetchedCollection

public boolean isContainsJoinFetchedCollection()
Getter for property 'containsJoinFetchedCollection', which flags whether this fetch profile contained any collection join fetches.

Returns:
Value for property 'containsJoinFetchedCollection'.

isContainsJoinFetchedBag

public boolean isContainsJoinFetchedBag()
Getter for property 'containsJoinFetchedBag', which flags whether this fetch profile contained any bag join fetches

Returns:
Value for property 'containsJoinFetchedBag'.


Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.