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

public Class AttributeGroup

extends CoreAttributeGroup<AttributeItem, ClassDescriptor>
implements Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable
Known Direct Subclasses
org.eclipse.persistence.queries.FetchGroup, org.eclipse.persistence.queries.LoadGroup, org.eclipse.persistence.sessions.CopyGroup
Imports
java.io.Serializable, java.util.HashMap, .HashSet, .IdentityHashMap, .Map, org.eclipse.persistence.core.queries.CoreAttributeGroup, org.eclipse.persistence.descriptors.ClassDescriptor, org.eclipse.persistence.internal.queries.AttributeItem, org.eclipse.persistence.sessions.CopyGroup

Purpose: An AttributeGroup represents a set of mappings and nested AttributeGroups for relationship mappings for an entity type. Responsibilities:

To reference nested attributes a dot ('.') notation is used to reference related attributes. All attribute names provided are assumed to be correct until processed against the mappings during usage of the group.

Author
ailitchev
Since
EclipseLink 2.1
See Also
FetchGroup, LoadGroup, CopyGroup

Field Summary

Inherited from org.eclipse.persistence.core.queries.CoreAttributeGroup:
allsubclassesisValidateditemsnamesubClassessuperClassGrouptypetypeName

Constructor Summary

AccessConstructor and Description
public
public
AttributeGroup(String name, Class<?> type, boolean isValidated)

INTERNAL: This constructer is to only be used by EclipseLink internally

public
AttributeGroup(String name, String type, boolean isValidated)

public

Method Summary

Modifier and TypeMethod and Description
public void
addAttribute(String
A simple attribute, array or attributes forming a path
attributeNameOrPath
,
AttributeGroup
- an AttributeGroup to be added.
group
)

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 AttributeGroup
clone()

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

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

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

Returns AttributeGroup corresponding to the passed (possibly nested) attribute.
public AttributeItem

Returns:

item or null
getItem
(String attributeNameOrPath)

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

INTERNAL: Lookup the AttributeItemfor the provided attribute name or path.
public boolean
isConcurrent()

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

INTERNAL: Only LoadGroups allow concurrency.
public boolean
isCopyGroup()

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

INTERNAL: This method is used internally when converting to a copy group.
public boolean
public boolean
isSupersetOf(AttributeGroup anotherGroup)

Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.

protected AttributeGroup
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.core.queries.CoreAttributeGroup.newGroup.

Subclass may create different types.
protected AttributeItem
newItem(AttributeGroup group, String attrName)

Subclass may create different types.

protected AttributeItem
newItem(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, String attrName)

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

Subclass may create different types.
public CopyGroup
toCopyGroup()

Convert the group to a CopyGroup for usage with the copy() API.

public CopyGroup
toCopyGroup(Map<AttributeGroup, CopyGroup> cloneMap, Map<K, V> copies)

INTERNAL: This method is used internally when converting to a copy group.

public FetchGroup
toFetchGroup()

Convert the group to a FetchGroup for usage with queries.

public FetchGroup
toFetchGroup(Map<AttributeGroup, FetchGroup> cloneMap)

INTERNAL: This method is used internally when converting to a copy group.

public LoadGroup
toLoadGroup()

Convert the group to a LoadGroup for usage with queries.

public LoadGroup
toLoadGroup(Map<AttributeGroup, LoadGroup> cloneMap, boolean loadOnly)

Inherited from org.eclipse.persistence.core.queries.CoreAttributeGroup:
addAttributeaddAttributeaddAttributeaddAttributeKeyaddAttributesclonecontainsAttributecontainsAttributeInternalconvertconvertClassNamesToClassesequalsgetAllItemsgetAttributeNamesgetItemgetItemsgetNamegetSubClassGroupsgetTypegetTypeNamehashCodehasInheritancehasItemsinsertSubClassisFetchGroupisSupersetOfisValidatedremoveAttributesetAllSubclassessetAttributeNamessetNametoStringtoStringAdditionalInfotoStringItemstoStringPath

Constructor Detail

AttributeGroupback to summary
public AttributeGroup(String name)
AttributeGroupback to summary
public AttributeGroup(String name, Class<?> type, boolean isValidated)

INTERNAL: This constructer is to only be used by EclipseLink internally

AttributeGroupback to summary
public AttributeGroup(String name, String type, boolean isValidated)
AttributeGroupback to summary
public AttributeGroup()

Method Detail

addAttributeback to summary
public void addAttribute(String attributeNameOrPath, AttributeGroup group)

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:AttributeGroup

- an AttributeGroup to be added.

cloneback to summary
public AttributeGroup clone()

Overrides org.eclipse.persistence.core.queries.CoreAttributeGroup.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:AttributeGroup

a clone of this instance.

Annotations
@Override
findGroupback to summary
public AttributeGroup findGroup(ClassDescriptor type)

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

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

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

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

Annotations
@Override
getItemback to summary
public AttributeItem getItem(String attributeNameOrPath)

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

INTERNAL: Lookup the AttributeItemfor the provided attribute name or path.

Returns:AttributeItem

item or null

Annotations
@Override
Exceptions
IllegalArgumentException:
if name is not valid attribute name or path
isConcurrentback to summary
public boolean isConcurrent()

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

INTERNAL: Only LoadGroups allow concurrency.

Annotations
@Override
isCopyGroupback to summary
public boolean isCopyGroup()

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

INTERNAL: This method is used internally when converting to a copy group.

Annotations
@Override
isLoadGroupback to summary
public boolean isLoadGroup()

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

Annotations
@Override
isSupersetOfback to summary
public boolean isSupersetOf(AttributeGroup anotherGroup)

Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.

newGroupback to summary
protected AttributeGroup 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.core.queries.CoreAttributeGroup.newGroup.

Subclass may create different types.

Annotations
@Override
newItemback to summary
protected AttributeItem newItem(AttributeGroup group, String attrName)

Subclass may create different types.

newItemback to summary
protected AttributeItem newItem(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, String attrName)

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

Subclass may create different types.

Annotations
@Override
toCopyGroupback to summary
public CopyGroup toCopyGroup()

Convert the group to a CopyGroup for usage with the copy() API.

toCopyGroupback to summary
public CopyGroup toCopyGroup(Map<AttributeGroup, CopyGroup> cloneMap, Map<K, V> copies)

INTERNAL: This method is used internally when converting to a copy group.

toFetchGroupback to summary
public FetchGroup toFetchGroup()

Convert the group to a FetchGroup for usage with queries.

toFetchGroupback to summary
public FetchGroup toFetchGroup(Map<AttributeGroup, FetchGroup> cloneMap)

INTERNAL: This method is used internally when converting to a copy group.

toLoadGroupback to summary
public LoadGroup toLoadGroup()

Convert the group to a LoadGroup for usage with queries.

toLoadGroupback to summary
public LoadGroup toLoadGroup(Map<AttributeGroup, LoadGroup> cloneMap, boolean loadOnly)