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

public Class FetchProfile

extends Object
Class Inheritance
Imports
java.util.Map, .HashMap, org.slf4j.Logger, .LoggerFactory, org.hibernate.engine.SessionFactoryImplementor, org.hibernate.type.Type, .BagType

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

Field Summary

Modifier and TypeField and Description
private Fetch
private boolean
private boolean
private Map<String, Fetch>
private static final Logger
private final String

Constructor Summary

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

A 'fetch profile' is uniquely named within a SessionFactory, thus it is also uniquely and easily identifiable within that SessionFactory.

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
)

Add a fetch to the profile.

public void
addFetch(Association
The association to be fetched
association
,
Fetch.Style
The style to apply
style
)

Add a fetch to the profile.

public void
addFetch(Fetch
The fetch to add.
fetch
)

Add a fetch to the profile.

public Fetch
public Map<String, Fetch>

Returns:

Value for property 'fetches'.
getFetches
()

Getter for property 'fetches'.

public String

Returns:

Value for property 'name'.
getName
()

Getter for property 'name'.

public boolean

Returns:

Value for property 'containsJoinFetchedBag'.
isContainsJoinFetchedBag
()

Getter for property 'containsJoinFetchedBag', which flags whether this fetch profile contained any bag join fetches

public boolean

Returns:

Value for property 'containsJoinFetchedCollection'.
isContainsJoinFetchedCollection
()

Getter for property 'containsJoinFetchedCollection', which flags whether this fetch profile contained any collection join fetches.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

bagJoinFetchback to summary
private Fetch bagJoinFetch
containsJoinFetchedBagback to summary
private boolean containsJoinFetchedBag
containsJoinFetchedCollectionback to summary
private boolean containsJoinFetchedCollection
fetchesback to summary
private Map<String, Fetch> fetches
logback to summary
private static final Logger log
nameback to summary
private final String name

Constructor Detail

FetchProfileback to summary
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:String

The name under which we are bound in the sessionFactory

Method Detail

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

Add a fetch to the profile.

Parameters
association:Association

The association to be fetched

fetchStyleName:String

The name of the fetch style to apply

Annotations
@SuppressWarnings:UnusedDeclaration
addFetchback to summary
public void addFetch(Association association, Fetch.Style style)

Add a fetch to the profile.

Parameters
association:Association

The association to be fetched

style:Fetch.Style

The style to apply

addFetchback to summary
public void addFetch(Fetch fetch)

Add a fetch to the profile.

Parameters
fetch:Fetch

The fetch to add.

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

Getter for property 'fetches'. Map of Fetch instances, keyed by association role

Returns:Map<String, Fetch>

Value for property 'fetches'.

Annotations
@SuppressWarnings:UnusedDeclaration
getNameback to summary
public String getName()

Getter for property 'name'.

Returns:String

Value for property 'name'.

isContainsJoinFetchedBagback to summary
public boolean isContainsJoinFetchedBag()

Getter for property 'containsJoinFetchedBag', which flags whether this fetch profile contained any bag join fetches

Returns:boolean

Value for property 'containsJoinFetchedBag'.

Annotations
@SuppressWarnings:UnusedDeclaration
isContainsJoinFetchedCollectionback to summary
public boolean isContainsJoinFetchedCollection()

Getter for property 'containsJoinFetchedCollection', which flags whether this fetch profile contained any collection join fetches.

Returns:boolean

Value for property 'containsJoinFetchedCollection'.

Annotations
@SuppressWarnings:UnusedDeclaration