EclipseLink 2.1.0, build 'v20100529-r7411' API Reference

org.eclipse.persistence.queries
Class AttributeGroup

java.lang.Object
  extended by org.eclipse.persistence.queries.AttributeGroup
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable
Direct Known Subclasses:
FetchGroup, LoadGroup

public class AttributeGroup
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable

Purpose: Base class for FetchGroup and LoadGroup.

See Also:
Serialized Form
Author:
ailitchev
Since:
EclipseLink 2.1

Field 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
 org.eclipse.persistence.internal.queries.AttributeItem addAttribute(java.lang.String attributeNameOrPath)
          Add an basic attribute or nested attribute with each String representing an attribute on the path to what needs to be included in the AttributeGroup.
 org.eclipse.persistence.internal.queries.AttributeItem addAttribute(java.lang.String attributeNameOrPath, AttributeGroup group)
           
 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.
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)
          TODO
 java.util.Map<java.lang.String,org.eclipse.persistence.internal.queries.AttributeItem> getItems()
           
 java.lang.String getName()
           
 boolean hasItems()
           
 boolean isFetchGroup()
           
 boolean isLoadGroup()
           
 boolean isSupersetOf(AttributeGroup anotherGroup)
          Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.
 AttributeGroup newGroup(java.lang.String name, AttributeGroup parent)
           
 org.eclipse.persistence.internal.queries.AttributeItem newItem(AttributeGroup group, java.lang.String attrName)
           
 void removeAttribute(java.lang.String attributeNameOrPath)
          Remove an attribute from the group.
 void setAttributeNames(java.util.Set attributeNames)
           
 void setName(java.lang.String name)
           
 FetchGroup toFetchGroup()
           
 LoadGroup toLoadGroup()
           
 java.lang.String toString()
           
 java.lang.String toStringAdditionalInfo()
           
protected  java.lang.String toStringItems()
           
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

items

protected java.util.Map<java.lang.String,org.eclipse.persistence.internal.queries.AttributeItem> items
Specified attributes in the group mapped to their AttributeItems

Constructor Detail

AttributeGroup

public AttributeGroup(java.lang.String name)

AttributeGroup

public AttributeGroup()
Method Detail

newItem

public org.eclipse.persistence.internal.queries.AttributeItem newItem(AttributeGroup group,
                                                                      java.lang.String attrName)

newGroup

public AttributeGroup newGroup(java.lang.String name,
                               AttributeGroup parent)

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()

setAttributeNames

public void setAttributeNames(java.util.Set attributeNames)

hasItems

public boolean hasItems()

getItems

public java.util.Map<java.lang.String,org.eclipse.persistence.internal.queries.AttributeItem> getItems()

containsAttribute

public boolean containsAttribute(java.lang.String attributeNameOrPath)
Return if the attribute is defined in the group.


addAttribute

public org.eclipse.persistence.internal.queries.AttributeItem addAttribute(java.lang.String attributeNameOrPath)
Add an 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");
group.addAttribute("manager.address");

Parameters:
attrPathOrName - A simple attribute, array or attributes forming a path

addAttribute

public org.eclipse.persistence.internal.queries.AttributeItem addAttribute(java.lang.String attributeNameOrPath,
                                                                           AttributeGroup group)

addAttributes

public void addAttributes(java.util.Collection<java.lang.String> attrOrPaths)
Add a set of attributes to the group.


getGroup

public AttributeGroup getGroup(java.lang.String attributeNameOrPath)
Returns AttributeGroup corresponding to the passed (possibly nested) attribute.


getItem

public org.eclipse.persistence.internal.queries.AttributeItem getItem(java.lang.String attributeNameOrPath)
TODO

Parameters:
attributeNameOrPath -
Returns:

removeAttribute

public void removeAttribute(java.lang.String attributeNameOrPath)
Remove an attribute from the group.


isSupersetOf

public boolean isSupersetOf(AttributeGroup anotherGroup)
Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.


convert

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.


equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toStringAdditionalInfo

public java.lang.String toStringAdditionalInfo()

toStringItems

protected java.lang.String toStringItems()

toStringPath

protected static java.lang.String toStringPath(java.lang.String[] attributePath,
                                               int position)

isFetchGroup

public boolean isFetchGroup()

toFetchGroup

public FetchGroup toFetchGroup()

isLoadGroup

public boolean isLoadGroup()

toLoadGroup

public LoadGroup toLoadGroup()

clone

public AttributeGroup clone()
Overrides:
clone in class java.lang.Object

EclipseLink 2.1.0, build 'v20100529-r7411' API Reference