public interface FetchGroup
Fetch groups are updated using methods on this interface. An instance of
a class implementing this interface can be obtained from
PersistenceManager.getFetchGroup(java.lang.Class, java.lang.String)
or
PersistenceManagerFactory.getFetchGroup(java.lang.Class, java.lang.String)
.
A FetchGroup can be unscoped or can be in one of two scopes (the
PersistenceManager
or the PersistenceManagerFactory
scope).
Unscoped FetchGroups do not affect any behavior.
A FetchGroup in PersistenceManager scope hides the corresponding
FetchGroup in the PersistenceManagerFactory scope.
PersistenceManager.getFetchGroup(java.lang.Class, java.lang.String)
,
it is immediately in scope of its PersistenceManager
.
Subsequent modifications of the FetchGroup
immediately affect FetchPlan
s that contain the
FetchGroup
.
PersistenceManagerFactory.getFetchGroup(java.lang.Class, java.lang.String)
, it is unscoped.
PersistenceManagerFactory.addFetchGroups(javax.jdo.FetchGroup...)
, it is put in scope of the
PersistenceManagerFactory
.
PersistenceManagerFactory.removeFetchGroups(javax.jdo.FetchGroup...)
,
PersistenceManagerFactory.removeAllFetchGroups()
, or replaced via
PersistenceManagerFactory.addFetchGroups(javax.jdo.FetchGroup...)
, it is unscoped.
Modifier and Type | Field and Description |
---|---|
static String |
ALL
For use with
addCategory(java.lang.String) and removeCategory(java.lang.String) calls. |
static String |
BASIC
For use with
addCategory(java.lang.String) and removeCategory(java.lang.String) calls. |
static String |
DEFAULT
For use with
addCategory(java.lang.String) and removeCategory(java.lang.String) calls. |
static String |
MULTIVALUED
For use with
addCategory(java.lang.String) and removeCategory(java.lang.String) calls. |
static String |
RELATIONSHIP
For use with
addCategory(java.lang.String) and removeCategory(java.lang.String) calls. |
Modifier and Type | Method and Description |
---|---|
FetchGroup |
addCategory(String categoryName)
Add the members (fields or properties) of the named category
to the set of members in this FetchGroup.
|
FetchGroup |
addMember(String memberName)
Add the member (field or property) to the set of members in this
FetchGroup.
|
FetchGroup |
addMembers(String... memberNames)
Add the member (field or property) to the set of members in this
FetchGroup.
|
boolean |
equals(Object other)
Return whether this instance is equal to the other.
|
Set |
getMembers()
Return an immutable Set of String containing the names of all members.
|
String |
getName()
Get the name of this FetchGroup.
|
boolean |
getPostLoad()
Get the post-load property of this FetchGroup.
|
int |
getRecursionDepth(String memberName)
Get the recursion-depth for this member.
|
Class |
getType()
Get the persistent type (class or interface) of this FetchGroup.
|
int |
hashCode()
Return the hashCode for this instance.
|
boolean |
isUnmodifiable()
Return whether this FetchGroup is unmodifiable.
|
FetchGroup |
removeCategory(String categoryName)
Remove the members (fields or properties) of the named category
from the set of members in this FetchGroup.
|
FetchGroup |
removeMember(String memberName)
Remove the member (field or property) from the set of members in this FetchGroup.
|
FetchGroup |
removeMembers(String... memberNames)
Remove the member (field or property) from the set of members in this
FetchGroup.
|
FetchGroup |
setPostLoad(boolean postLoad)
Set the post-load property of this FetchGroup.
|
FetchGroup |
setRecursionDepth(String memberName,
int recursionDepth)
Set the recursion-depth for this member.
|
FetchGroup |
setUnmodifiable()
Make this FetchGroup unmodifiable.
|
static final String DEFAULT
addCategory(java.lang.String)
and removeCategory(java.lang.String)
calls.
This category includes members defined in the default fetch group
in xml or annotations. Redefining the default fetch group via the API
does not affect the members defined by this category.
Using this category also sets the fetch-depth for the members in the default fetch group.
static final String RELATIONSHIP
addCategory(java.lang.String)
and removeCategory(java.lang.String)
calls.
This category includes members of all relationship types.static final String MULTIVALUED
addCategory(java.lang.String)
and removeCategory(java.lang.String)
calls.
This category includes members of all multi-valued types, including
Collection, array, and Map types of basic and relationship types.static final String BASIC
addCategory(java.lang.String)
and removeCategory(java.lang.String)
calls.
This category includes members of all primitive and immutable
object class types as defined in section 6.4 of the specification,
including String, Locale, Currency, BigDecimal, and BigInteger;
as well as Date and its jdbc subtypes and Enum types.static final String ALL
addCategory(java.lang.String)
and removeCategory(java.lang.String)
calls.
This category includes all members in the persistent type.
Using this category also sets the fetch-depth for the members in the default fetch group.
int hashCode()
boolean equals(Object other)
String getName()
Class getType()
boolean getPostLoad()
FetchGroup setPostLoad(boolean postLoad)
postLoad
- Whether to post load this fetch groupJDOUserException
- if the FetchGroup is unmodifiableFetchGroup addMember(String memberName)
memberName
- the name of a member to add to the FetchGroupJDOUserException
- if the parameter is not a member of the
persistent typeJDOUserException
- if the FetchGroup is unmodifiableFetchGroup addMembers(String... memberNames)
memberNames
- the names of members to add to the FetchGroupJDOUserException
- if any parameter is not a member of the
persistent typeJDOUserException
- if the FetchGroup is unmodifiableFetchGroup removeMember(String memberName)
memberName
- Name of the member of the class to remove from the FetchGroup.JDOUserException
- if the parameter is not a member of the persistent typeJDOUserException
- if the FetchGroup is unmodifiableFetchGroup removeMembers(String... memberNames)
memberNames
- Member names of the class to remove from this FetchGroup.JDOUserException
- if any parameter is not a member of the persistent typeJDOUserException
- if the FetchGroup is unmodifiableFetchGroup addCategory(String categoryName)
addMembers(java.lang.String...)
was called. After this
method executes, the category is not remembered.categoryName
- Category to add to this FetchGroup.JDOUserException
- if the FetchGroup is unmodifiableFetchGroup removeCategory(String categoryName)
removeMembers(java.lang.String...)
was called. After this
method executes, the category is not remembered.categoryName
- Category to remove from this FetchGroup.JDOUserException
- if the FetchGroup is unmodifiableFetchGroup setRecursionDepth(String memberName, int recursionDepth)
memberName
- the name of the field or propertyrecursionDepth
- the value for the recursion-depth propertyJDOUserException
- if the member does not existJDOUserException
- if the FetchGroup is unmodifiableint getRecursionDepth(String memberName)
memberName
- the name of the field or propertyJDOUserException
- if the member is not in the FetchGroupSet getMembers()
FetchGroup setUnmodifiable()
boolean isUnmodifiable()
setPostLoad(boolean)
, addMember(java.lang.String)
, removeMember(java.lang.String)
,
addMembers(java.lang.String...)
, removeMembers(java.lang.String...)
,
addCategory(java.lang.String)
, and removeCategory(java.lang.String)
will throw JDOUserException
.Copyright © 2005–1970 Apache Software Foundation. All rights reserved.