public class AttributeGroup extends Object implements Serializable, Cloneable
FetchGroup
.
LoadGroup
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.
FetchGroup
,
LoadGroup
,
CopyGroup
,
Serialized FormConstructor and Description |
---|
AttributeGroup() |
AttributeGroup(String name) |
Modifier and Type | Method and Description |
---|---|
void |
addAttribute(String attributeNameOrPath)
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.
|
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.
|
void |
addAttributes(Collection<String> attrOrPaths)
Add a set of attributes to the group.
|
AttributeGroup |
clone() |
boolean |
containsAttribute(String attributeNameOrPath)
Return if the attribute is defined in the group.
|
boolean |
equals(Object obj) |
Set<String> |
getAttributeNames() |
AttributeGroup |
getGroup(String attributeNameOrPath)
Returns AttributeGroup corresponding to the passed (possibly nested)
attribute.
|
org.eclipse.persistence.internal.queries.AttributeItem |
getItem(String attributeNameOrPath)
INTERNAL:
Lookup the
AttributeItem for the provided attribute name or path. |
Map<String,org.eclipse.persistence.internal.queries.AttributeItem> |
getItems()
INTERNAL:
|
String |
getName() |
boolean |
hasItems()
Indicates whether the group has at least one attribute.
|
boolean |
isCopyGroup() |
boolean |
isFetchGroup() |
boolean |
isLoadGroup() |
boolean |
isSupersetOf(AttributeGroup anotherGroup)
Return true if this AttributeGroup is a super-set of the passed in
AttributeGroup.
|
void |
removeAttribute(String attributeNameOrPath)
Remove an attribute from the group.
|
void |
setAttributeNames(Set attributeNames) |
void |
setName(String name) |
CopyGroup |
toCopyGroup() |
FetchGroup |
toFetchGroup() |
LoadGroup |
toLoadGroup() |
String |
toString() |
public AttributeGroup(String name)
public AttributeGroup()
public String getName()
public void setName(String name)
public void setAttributeNames(Set attributeNames)
public boolean hasItems()
public Map<String,org.eclipse.persistence.internal.queries.AttributeItem> getItems()
public boolean containsAttribute(String attributeNameOrPath)
public void addAttribute(String attributeNameOrPath)
Example:
group.addAttribute("firstName");
group.addAttribute("manager.address");
attrPathOrName
- A simple attribute, array or attributes forming a pathpublic void addAttribute(String attributeNameOrPath, AttributeGroup group)
Example:
group.addAttribute("firstName", group1);
Note that existing group corresponding to attributeNameOrPath
will be overridden with the passed group.
group.addAttribute("manager.address", group2);
attrPathOrName
- A simple attribute, array or attributes forming a pathgroup
- - an AttributeGroup to be added.public void addAttributes(Collection<String> attrOrPaths)
public AttributeGroup getGroup(String attributeNameOrPath)
public org.eclipse.persistence.internal.queries.AttributeItem getItem(String attributeNameOrPath)
AttributeItem
for the provided attribute name or path.IllegalArgumentException
- if name is not valid attribute name or pathpublic void removeAttribute(String attributeNameOrPath)
public boolean isSupersetOf(AttributeGroup anotherGroup)
public boolean isFetchGroup()
public FetchGroup toFetchGroup()
public boolean isCopyGroup()
public CopyGroup toCopyGroup()
public boolean isLoadGroup()
public LoadGroup toLoadGroup()
public AttributeGroup clone()