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

public Class FetchProfile

extends Object
Class Inheritance
Imports
java.util.HashMap, .Map, org.hibernate.internal.CoreLogging, .CoreMessageLogger, org.hibernate.type.BagType, .Type

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 CoreMessageLogger
private final String

Constructor Summary

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

Constructs a FetchProfile, supplying its unique name (unique within the 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(final Fetch
The fetch to add.
fetch
)

Add a fetch to the profile.

public Fetch

Returns:

The fetch, or null if a matching one was not found
getFetchByRole
(String
The role identifying the fetch
role
)

Obtain the fetch associated with the given role.

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 CoreMessageLogger LOG
nameback to summary
private final String name

Constructor Detail

FetchProfileback to summary
public FetchProfile(String name)

Constructs a FetchProfile, supplying its unique name (unique within the 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(final Fetch fetch)

Add a fetch to the profile.

Parameters
fetch:Fetch

The fetch to add.

getFetchByRoleback to summary
public Fetch getFetchByRole(String role)

Obtain the fetch associated with the given role.

Parameters
role:String

The role identifying the fetch

Returns:Fetch

The fetch, or null if a matching one was not found

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