Package org.eclipse.persistence.queries
Class AttributeGroup
- java.lang.Object
-
- org.eclipse.persistence.core.queries.CoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
- org.eclipse.persistence.queries.AttributeGroup
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
CopyGroup,FetchGroup,LoadGroup
public class AttributeGroup extends CoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor> implements java.io.Serializable, java.lang.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.
- See Also:
FetchGroup,LoadGroup,CopyGroup, Serialized Form- Author:
- ailitchev
- Since:
- EclipseLink 2.1
-
-
Field Summary
-
Fields inherited from class org.eclipse.persistence.core.queries.CoreAttributeGroup
allsubclasses, isValidated, items, name, subClasses, superClassGroup, type, typeName
-
-
Constructor Summary
Constructors Constructor Description AttributeGroup()AttributeGroup(java.lang.String name)AttributeGroup(java.lang.String name, java.lang.Class type, boolean isValidated)INTERNAL: This constructer is to only be used by EclipseLink internallyAttributeGroup(java.lang.String name, java.lang.String type, boolean isValidated)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAttribute(java.lang.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.AttributeGroupclone()AttributeGroupfindGroup(ClassDescriptor type)AttributeGroupgetGroup(java.lang.String attributeNameOrPath)Returns AttributeGroup corresponding to the passed (possibly nested) attribute.org.eclipse.persistence.internal.queries.AttributeItemgetItem(java.lang.String attributeNameOrPath)INTERNAL: Lookup theAttributeItemfor the provided attribute name or path.booleanisConcurrent()INTERNAL: Only LoadGroups allow concurrency.booleanisCopyGroup()INTERNAL: This method is used internally when converting to a copy group.booleanisLoadGroup()booleanisSupersetOf(AttributeGroup anotherGroup)Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.protected AttributeGroupnewGroup(java.lang.String name, CoreAttributeGroup parent)Subclass may create different types.protected org.eclipse.persistence.internal.queries.AttributeItemnewItem(CoreAttributeGroup group, java.lang.String attrName)Subclass may create different types.protected org.eclipse.persistence.internal.queries.AttributeItemnewItem(AttributeGroup group, java.lang.String attrName)Subclass may create different types.CopyGrouptoCopyGroup()Convert the group to a CopyGroup for usage with the copy() API.CopyGrouptoCopyGroup(java.util.Map<AttributeGroup,CopyGroup> cloneMap, java.util.Map copies)INTERNAL: This method is used internally when converting to a copy group.FetchGrouptoFetchGroup()Convert the group to a FetchGroup for usage with queries.FetchGrouptoFetchGroup(java.util.Map<AttributeGroup,FetchGroup> cloneMap)INTERNAL: This method is used internally when converting to a copy group.LoadGrouptoLoadGroup()Convert the group to a LoadGroup for usage with queries.LoadGrouptoLoadGroup(java.util.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 Detail
-
AttributeGroup
public AttributeGroup(java.lang.String name)
-
AttributeGroup
public AttributeGroup(java.lang.String name, java.lang.Class type, boolean isValidated)INTERNAL: This constructer is to only be used by EclipseLink internally- Parameters:
name-type-
-
AttributeGroup
public AttributeGroup(java.lang.String name, java.lang.String type, boolean isValidated)
-
AttributeGroup
public AttributeGroup()
-
-
Method Detail
-
addAttribute
public void addAttribute(java.lang.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);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
public AttributeGroup getGroup(java.lang.String attributeNameOrPath)
Returns AttributeGroup corresponding to the passed (possibly nested) attribute.- Overrides:
getGroupin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
isSupersetOf
public boolean isSupersetOf(AttributeGroup anotherGroup)
Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.
-
getItem
public org.eclipse.persistence.internal.queries.AttributeItem getItem(java.lang.String attributeNameOrPath)
INTERNAL: Lookup theAttributeItemfor the provided attribute name or path.- Overrides:
getItemin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>- Returns:
- item or null
- Throws:
java.lang.IllegalArgumentException- if name is not valid attribute name or path
-
newItem
protected org.eclipse.persistence.internal.queries.AttributeItem newItem(AttributeGroup group, java.lang.String attrName)
Subclass may create different types.
-
findGroup
public AttributeGroup findGroup(ClassDescriptor type)
- Overrides:
findGroupin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
toFetchGroup
public FetchGroup toFetchGroup()
Convert the group to a FetchGroup for usage with queries.
-
toFetchGroup
public FetchGroup toFetchGroup(java.util.Map<AttributeGroup,FetchGroup> cloneMap)
INTERNAL: This method is used internally when converting to a copy group.- Parameters:
cloneMap-- Returns:
-
isCopyGroup
public boolean isCopyGroup()
INTERNAL: This method is used internally when converting to a copy group.- Overrides:
isCopyGroupin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>- Returns:
-
toCopyGroup
public CopyGroup toCopyGroup()
Convert the group to a CopyGroup for usage with the copy() API.
-
toCopyGroup
public CopyGroup toCopyGroup(java.util.Map<AttributeGroup,CopyGroup> cloneMap, java.util.Map copies)
INTERNAL: This method is used internally when converting to a copy group.- Parameters:
cloneMap-- Returns:
-
isLoadGroup
public boolean isLoadGroup()
- Overrides:
isLoadGroupin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
toLoadGroup
public LoadGroup toLoadGroup()
Convert the group to a LoadGroup for usage with queries.
-
toLoadGroup
public LoadGroup toLoadGroup(java.util.Map<AttributeGroup,LoadGroup> cloneMap, boolean loadOnly)
-
clone
public AttributeGroup clone()
- Overrides:
clonein classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
isConcurrent
public boolean isConcurrent()
INTERNAL: Only LoadGroups allow concurrency.- Overrides:
isConcurrentin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
newItem
protected org.eclipse.persistence.internal.queries.AttributeItem newItem(CoreAttributeGroup group, java.lang.String attrName)
Subclass may create different types.- Overrides:
newItemin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
newGroup
protected AttributeGroup newGroup(java.lang.String name, CoreAttributeGroup parent)
Subclass may create different types.- Overrides:
newGroupin classCoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,ClassDescriptor>
-
-