|
EclipseLink 2.1.0, build 'v20100529-r7411' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.persistence.queries.AttributeGroup
org.eclipse.persistence.queries.FetchGroup
public class FetchGroup
Purpose: A fetch group is a performance enhancement that allows a group of attributes of an object to be loaded on demand, which means that the data for an attribute might not loaded from the underlying data source until an explicit access call for the attribute first occurs. It avoids the wasteful practice of loading up all data of the object's attributes, in which the user is interested in only partial of them.
A great deal of caution and careful system use case analysis should be use when using the fetch group feature, as the extra round-trip would well offset the gain from the deferred loading in many cases.
EclipseLink fetch group support is twofold: the pre-defined fetch groups at the descriptor level; and dynamic (use case) fetch groups at the query level.
Every query can has at most one fetch group. There is an optional pre-defined default fetch group at the descriptor level. If set, and the query has no fetch group being set, the default fetch group would be used, unless query.setShouldUseDefaultFetchGroup(false) is also called. In the latter case, the full object will be fetched after the query execution.
FetchGroup
,
FetchGroupTracker
,
Serialized FormField Summary |
---|
Fields inherited from class org.eclipse.persistence.queries.AttributeGroup |
---|
items |
Constructor Summary | |
---|---|
FetchGroup()
|
|
FetchGroup(java.lang.String name)
|
Method Summary | |
---|---|
FetchGroup |
clone()
|
java.util.Set<java.lang.String> |
getAttributes()
Deprecated. |
FetchGroup |
getGroup(java.lang.String attributeNameOrPath)
Returns FetchGroup corresponding to the passed (possibly nested) attribute. |
boolean |
isEntityFetchGroup()
|
boolean |
isFetchGroup()
|
FetchGroup |
newGroup(java.lang.String name,
AttributeGroup parent)
|
java.lang.String |
onUnfetchedAttribute(FetchGroupTracker entity,
java.lang.String attributeName)
INTERNAL: Called on attempt to get value of an attribute that hasn't been fetched yet. |
java.lang.String |
onUnfetchedAttributeForSet(FetchGroupTracker entity,
java.lang.String attributeName)
INTERNAL: Called on attempt to assign value to an attribute that hasn't been fetched yet. |
void |
setShouldLoad(boolean shouldLoad)
|
void |
setShouldLoadAll(boolean shouldLoad)
|
boolean |
shouldLoad()
|
LoadGroup |
toLoadGroupLoadOnly()
|
Methods inherited from class org.eclipse.persistence.queries.AttributeGroup |
---|
addAttribute, addAttribute, addAttributes, containsAttribute, convert, equals, getAttributeNames, getItem, getItems, getName, hasItems, isLoadGroup, isSupersetOf, newItem, removeAttribute, setAttributeNames, setName, toFetchGroup, toLoadGroup, toString, toStringAdditionalInfo, toStringItems, toStringPath |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FetchGroup()
public FetchGroup(java.lang.String name)
Method Detail |
---|
@Deprecated public java.util.Set<java.lang.String> getAttributes()
public java.lang.String onUnfetchedAttribute(FetchGroupTracker entity, java.lang.String attributeName)
public java.lang.String onUnfetchedAttributeForSet(FetchGroupTracker entity, java.lang.String attributeName)
public void setShouldLoad(boolean shouldLoad)
public void setShouldLoadAll(boolean shouldLoad)
public boolean shouldLoad()
public FetchGroup newGroup(java.lang.String name, AttributeGroup parent)
newGroup
in class AttributeGroup
public boolean isFetchGroup()
isFetchGroup
in class AttributeGroup
public boolean isEntityFetchGroup()
public LoadGroup toLoadGroupLoadOnly()
public FetchGroup clone()
clone
in class AttributeGroup
public FetchGroup getGroup(java.lang.String attributeNameOrPath)
getGroup
in class AttributeGroup
|
EclipseLink 2.1.0, build 'v20100529-r7411' API Reference | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |