Top Description Fields Constructors Methods
org.eclipse.persistence.queries

public Class LoadGroup

extends AttributeGroup
Class Inheritance
Imports
org.eclipse.persistence.core.queries.CoreAttributeGroup

Purpose: Used to load specified relationship attributes and nested relationship attributes.

A LoadGroup can be configured for use on a query using ObjectLevelReadQuery#setLoadGroup(LoadGroup) or in the case of JPA users with LOAD_GROUP query hint. Alternatively a FetchGroup could be used with FetchGroup#shouldLoad() set to true and the FetchGroup configured on a query be executed.

Author
ailitchev
Since
Eclipselink 2.1
See Also
FetchGroup

Field Summary

Modifier and TypeField and Description
protected Boolean

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(String
A simple attribute, array or attributes forming a path
attributeNameOrPath
,
CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>>
- an AttributeGroup to be added.
group
)

Overrides org.eclipse.persistence.core.queries.CoreAttributeGroup.addAttribute.

Add a basic attribute or nested attribute with each String representing an attribute on the path to what needs to be included in the AttributeGroup.
public void
addAttribute(String attributeNameOrPath, LoadGroup group)

public LoadGroup
clone()

Overrides org.eclipse.persistence.queries.AttributeGroup.clone.

Creates and returns a copy of this object.
public LoadGroup
getGroup(String attributeNameOrPath)

Overrides org.eclipse.persistence.queries.AttributeGroup.getGroup.

Returns LoadGroup corresponding to the passed (possibly nested) attribute.
public Boolean
getIsConcurrent()

INTERNAL: Return if the load group should load its relationships concurrently.

public boolean
isConcurrent()

Overrides org.eclipse.persistence.queries.AttributeGroup.isConcurrent.

ADVANCED: Return if the load group should load its relationships concurrently.
public boolean
protected LoadGroup
newGroup(String name, CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>> parent)

Overrides org.eclipse.persistence.queries.AttributeGroup.newGroup.

Subclass may create different types.
public void
setIsConcurrent(Boolean isConcurrent)

ADVANCED: Set if the load group should load its relationships concurrently.

Inherited from org.eclipse.persistence.queries.AttributeGroup:
addAttributefindGroupgetItemisCopyGroupisSupersetOfnewItemnewItemtoCopyGrouptoCopyGrouptoFetchGrouptoFetchGrouptoLoadGrouptoLoadGroup

Field Detail

isConcurrentback to summary
protected Boolean isConcurrent

Constructor Detail

LoadGroupback to summary
public LoadGroup()
LoadGroupback to summary
public LoadGroup(String name)

Method Detail

addAttributeback to summary
public void addAttribute(String attributeNameOrPath, CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>> group)

Overrides org.eclipse.persistence.core.queries.CoreAttributeGroup.addAttribute.

Doc from org.eclipse.persistence.core.queries.CoreAttributeGroup.addAttribute.

Add a basic attribute or nested attribute with each String representing an attribute on the path to what needs to be included in the AttributeGroup.

Example: group.addAttribute("firstName", group1);
group.addAttribute("manager.address", group2);
Note that existing group corresponding to attributeNameOrPath will be overridden with the passed group.

Parameters
attributeNameOrPath:String

A simple attribute, array or attributes forming a path

group:CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>>

- an AttributeGroup to be added.

Annotations
@Override
addAttributeback to summary
public void addAttribute(String attributeNameOrPath, LoadGroup group)
cloneback to summary
public LoadGroup clone()

Overrides org.eclipse.persistence.queries.AttributeGroup.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:LoadGroup

a clone of this instance.

Annotations
@Override
getGroupback to summary
public LoadGroup getGroup(String attributeNameOrPath)

Overrides org.eclipse.persistence.queries.AttributeGroup.getGroup.

Returns LoadGroup corresponding to the passed (possibly nested) attribute.

Annotations
@Override
getIsConcurrentback to summary
public Boolean getIsConcurrent()

INTERNAL: Return if the load group should load its relationships concurrently.

isConcurrentback to summary
public boolean isConcurrent()

Overrides org.eclipse.persistence.queries.AttributeGroup.isConcurrent.

ADVANCED: Return if the load group should load its relationships concurrently. This will use the session's server platform's thread pool. Each of the query results objects relationships will be loaded on a different thread. This can improve performance by processing many queries at once. Concurrent load is only supported when a shared cache is used.

Annotations
@Override
isLoadGroupback to summary
public boolean isLoadGroup()

Overrides org.eclipse.persistence.queries.AttributeGroup.isLoadGroup.

Annotations
@Override
newGroupback to summary
protected LoadGroup newGroup(String name, CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem, DESCRIPTOR extends CoreDescriptor<ATTRIBUTE_GROUP extends CoreAttributeGroup, DESCRIPTOR_EVENT_MANAGER extends CoreDescriptorEventManager, FIELD extends CoreField, INHERITANCE_POLICY extends CoreInheritancePolicy, INSTANTIATION_POLICY extends CoreInstantiationPolicy, LIST extends List<E>, OBJECT_BUILDER extends CoreObjectBuilder>> parent)

Overrides org.eclipse.persistence.queries.AttributeGroup.newGroup.

Doc from org.eclipse.persistence.queries.AttributeGroup.newGroup.

Subclass may create different types.

Annotations
@Override
setIsConcurrentback to summary
public void setIsConcurrent(Boolean isConcurrent)

ADVANCED: Set if the load group should load its relationships concurrently. This will use the session's server platform's thread pool. Each of the query results objects relationships will be loaded on a different thread. This can improve performance by processing many queries at once. Concurrent load is only supported when a shared cache is used.