|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.queries.AttributeGroup
public class AttributeGroup
Purpose: An AttributeGroup represents a set of mappings and nested AttributeGroups for relationship mappings for an entity type. Responsibilities:
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 FormField Summary | |
---|---|
protected java.util.Map<java.lang.String,org.eclipse.persistence.internal.queries.AttributeItem> |
items
Specified attributes in the group mapped to their AttributeItems |
Constructor Summary | |
---|---|
AttributeGroup()
|
|
AttributeGroup(java.lang.String name)
|
Method Summary | |
---|---|
void |
addAttribute(java.lang.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(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. |
void |
addAttributes(java.util.Collection<java.lang.String> attrOrPaths)
Add a set of attributes to the group. |
AttributeGroup |
clone()
|
boolean |
containsAttribute(java.lang.String attributeNameOrPath)
Return if the attribute is defined in the group. |
boolean |
containsAttributeInternal(java.lang.String attributeName)
INTERNAL: Return if the attribute is defined in the group. |
protected java.lang.String[] |
convert(java.lang.String... nameOrPath)
Convert a provided name or path which could be a single attributeName, a single string with dot separated attribute names, or an array of attribute names defining the path. |
boolean |
equals(java.lang.Object obj)
|
java.util.Set<java.lang.String> |
getAttributeNames()
|
AttributeGroup |
getGroup(java.lang.String attributeNameOrPath)
Returns AttributeGroup corresponding to the passed (possibly nested) attribute. |
org.eclipse.persistence.internal.queries.AttributeItem |
getItem(java.lang.String attributeNameOrPath)
INTERNAL: Lookup the AttributeItem for the provided attribute name or path. |
java.util.Map<java.lang.String,org.eclipse.persistence.internal.queries.AttributeItem> |
getItems()
INTERNAL: |
java.lang.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. |
protected AttributeGroup |
newGroup(java.lang.String name,
AttributeGroup parent)
Subclass may create different types. |
protected org.eclipse.persistence.internal.queries.AttributeItem |
newItem(AttributeGroup group,
java.lang.String attrName)
Subclass may create different types. |
void |
removeAttribute(java.lang.String attributeNameOrPath)
Remove an attribute from the group. |
void |
setAttributeNames(java.util.Set attributeNames)
|
void |
setName(java.lang.String name)
|
CopyGroup |
toCopyGroup()
Convert the group to a CopyGroup for usage with the copy() API. |
FetchGroup |
toFetchGroup()
Convert the group to a FetchGroup for usage with queries. |
LoadGroup |
toLoadGroup()
Convert the group to a LoadGroup for usage with queries. |
java.lang.String |
toString()
|
protected java.lang.String |
toStringAdditionalInfo()
Used by toString to print additional info for derived classes. |
protected java.lang.String |
toStringItems()
Used by toString to print attribute items. |
protected static java.lang.String |
toStringPath(java.lang.String[] attributePath,
int position)
|
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected java.util.Map<java.lang.String,org.eclipse.persistence.internal.queries.AttributeItem> items
Constructor Detail |
---|
public AttributeGroup(java.lang.String name)
public AttributeGroup()
Method Detail |
---|
protected org.eclipse.persistence.internal.queries.AttributeItem newItem(AttributeGroup group, java.lang.String attrName)
protected AttributeGroup newGroup(java.lang.String name, AttributeGroup parent)
public java.lang.String getName()
public void setName(java.lang.String name)
public java.util.Set<java.lang.String> getAttributeNames()
public void setAttributeNames(java.util.Set attributeNames)
public boolean hasItems()
public java.util.Map<java.lang.String,org.eclipse.persistence.internal.queries.AttributeItem> getItems()
public boolean containsAttributeInternal(java.lang.String attributeName)
public boolean containsAttribute(java.lang.String attributeNameOrPath)
public void addAttribute(java.lang.String attributeNameOrPath)
Example:
group.addAttribute("firstName");
group.addAttribute("manager.address");
attrPathOrName
- A simple attribute, array or attributes forming a pathpublic void addAttribute(java.lang.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(java.util.Collection<java.lang.String> attrOrPaths)
public AttributeGroup getGroup(java.lang.String attributeNameOrPath)
public org.eclipse.persistence.internal.queries.AttributeItem getItem(java.lang.String attributeNameOrPath)
AttributeItem
for the provided attribute name or path.
java.lang.IllegalArgumentException
- if name is not valid attribute name or pathpublic void removeAttribute(java.lang.String attributeNameOrPath)
public boolean isSupersetOf(AttributeGroup anotherGroup)
protected java.lang.String[] convert(java.lang.String... nameOrPath)
java.lang.IllegalArgumentException
- if name is not valid attribute name or pathpublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String toStringAdditionalInfo()
protected java.lang.String toStringItems()
protected static java.lang.String toStringPath(java.lang.String[] attributePath, int position)
public boolean isFetchGroup()
public FetchGroup toFetchGroup()
public boolean isCopyGroup()
public CopyGroup toCopyGroup()
public boolean isLoadGroup()
public LoadGroup toLoadGroup()
public AttributeGroup clone()
clone
in class java.lang.Object
|
EclipseLink 2.3.2, build 'v20111125-r10461' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |