java.lang.Object
org.eclipse.persistence.core.queries.CoreAttributeGroup<AttributeItem,ClassDescriptor>
org.eclipse.persistence.queries.AttributeGroup
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
CopyGroup
,FetchGroup
,LoadGroup
public class AttributeGroup
extends CoreAttributeGroup<AttributeItem,ClassDescriptor>
implements Serializable, Cloneable
Purpose: An AttributeGroup represents a set of mappings and nested
AttributeGroups for relationship mappings for an entity type.
Responsibilities:
- Defines which attributes should be fetched from the database within a
FetchGroup
. - Define which relationship attributes should be populated in a resulting
entity graph within a
LoadGroup
- Define which attributes should be copied within a
CopyGroup
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.
- Since:
- EclipseLink 2.1
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.core.queries.CoreAttributeGroup
allsubclasses, isValidated, items, name, subClasses, superClassGroup, type, typeName
-
Constructor Summary
ConstructorDescriptionAttributeGroup
(String name) AttributeGroup
(String name, Class<?> type, boolean isValidated) INTERNAL: This constructer is to only be used by EclipseLink internallyAttributeGroup
(String name, String type, boolean isValidated) -
Method Summary
Modifier and TypeMethodDescriptionvoid
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.clone()
findGroup
(ClassDescriptor type) Returns AttributeGroup corresponding to the passed (possibly nested) attribute.INTERNAL: Lookup theAttributeItem
for the provided attribute name or path.boolean
INTERNAL: Only LoadGroups allow concurrency.boolean
INTERNAL: This method is used internally when converting to a copy group.boolean
boolean
isSupersetOf
(AttributeGroup anotherGroup) Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.protected AttributeGroup
newGroup
(String name, CoreAttributeGroup parent) Subclass may create different types.protected AttributeItem
newItem
(CoreAttributeGroup group, String attrName) Subclass may create different types.protected AttributeItem
newItem
(AttributeGroup group, String attrName) Subclass may create different types.Convert the group to a CopyGroup for usage with the copy() API.toCopyGroup
(Map<AttributeGroup, CopyGroup> cloneMap, Map copies) INTERNAL: This method is used internally when converting to a copy group.Convert the group to a FetchGroup for usage with queries.toFetchGroup
(Map<AttributeGroup, FetchGroup> cloneMap) INTERNAL: This method is used internally when converting to a copy group.Convert the group to a LoadGroup for usage with queries.toLoadGroup
(Map<AttributeGroup, LoadGroup> cloneMap, boolean loadOnly) Methods inherited from class org.eclipse.persistence.core.queries.CoreAttributeGroup
addAttribute, addAttribute, addAttribute, addAttributeKey, addAttributes, clone, containsAttribute, containsAttributeInternal, convert, convertClassNamesToClasses, equals, getAllItems, getAttributeNames, getItem, getItems, getName, getSubClassGroups, getType, getTypeName, hashCode, hasInheritance, hasItems, insertSubClass, isFetchGroup, isSupersetOf, isValidated, removeAttribute, setAllSubclasses, setAttributeNames, setName, toString, toStringAdditionalInfo, toStringItems, toStringPath
-
Constructor Details
-
AttributeGroup
-
AttributeGroup
INTERNAL: This constructer is to only be used by EclipseLink internally -
AttributeGroup
-
AttributeGroup
public AttributeGroup()
-
-
Method Details
-
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);
Note that existing group corresponding to attributeNameOrPath will be overridden with the passed group.
group.addAttribute("manager.address", group2);- Parameters:
attributeNameOrPath
- A simple attribute, array or attributes forming a pathgroup
- - an AttributeGroup to be added.
-
getGroup
Returns AttributeGroup corresponding to the passed (possibly nested) attribute.- Overrides:
getGroup
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
isSupersetOf
Return true if this AttributeGroup is a super-set of the passed in AttributeGroup. -
getItem
INTERNAL: Lookup theAttributeItem
for the provided attribute name or path.- Overrides:
getItem
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor> - Returns:
- item or null
- Throws:
IllegalArgumentException
- if name is not valid attribute name or path
-
newItem
Subclass may create different types. -
findGroup
- Overrides:
findGroup
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
toFetchGroup
Convert the group to a FetchGroup for usage with queries. -
toFetchGroup
INTERNAL: This method is used internally when converting to a copy group. -
isCopyGroup
public boolean isCopyGroup()INTERNAL: This method is used internally when converting to a copy group.- Overrides:
isCopyGroup
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
toCopyGroup
Convert the group to a CopyGroup for usage with the copy() API. -
toCopyGroup
INTERNAL: This method is used internally when converting to a copy group. -
isLoadGroup
public boolean isLoadGroup()- Overrides:
isLoadGroup
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
toLoadGroup
Convert the group to a LoadGroup for usage with queries. -
toLoadGroup
-
clone
- Overrides:
clone
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
isConcurrent
public boolean isConcurrent()INTERNAL: Only LoadGroups allow concurrency.- Overrides:
isConcurrent
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
newItem
Subclass may create different types.- Overrides:
newItem
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-
newGroup
Subclass may create different types.- Overrides:
newGroup
in classCoreAttributeGroup<AttributeItem,
ClassDescriptor>
-