Class CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem,DESCRIPTOR extends CoreDescriptor>
- java.lang.Object
-
- org.eclipse.persistence.core.queries.CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
AttributeGroup
public class CoreAttributeGroup<ATTRIBUTE_ITEM extends CoreAttributeItem,DESCRIPTOR extends CoreDescriptor> extends java.lang.Object implements java.io.Serializable, java.lang.CloneableINTERNAL Purpose: A generic super class for AttributeGroup and other subclasses- Since:
- EclipseLink 2.5
- Author:
- Matt MacIvor
- See Also:
AttributeGroup, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CoreAttributeGroup()CoreAttributeGroup(java.lang.String name)CoreAttributeGroup(java.lang.String name, java.lang.Class type, boolean isValidated)INTERNAL: This constructer is to only be used by EclipseLink internallyCoreAttributeGroup(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)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.voidaddAttribute(java.lang.String attributeNameOrPath, java.util.Collection<? extends CoreAttributeGroup> groups)Add an attribute and the corresponding list of AttributeGroups.voidaddAttribute(java.lang.String attributeNameOrPath, CoreAttributeGroup 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.voidaddAttributeKey(java.lang.String attributeNameOrPath, CoreAttributeGroup group)Add a basic attribute or nested attribute with each String representing the key of an attribute of type Map on the path to what needs to be included in the AttributeGroup.voidaddAttributes(java.util.Collection<java.lang.String> attrOrPaths)Add a set of attributes to the group.CoreAttributeGroupclone()CoreAttributeGroupclone(java.util.Map<CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>,CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>> cloneMap)INTERNAL: This method is used internally in the clone processing.booleancontainsAttribute(java.lang.String attributeNameOrPath)Return if the attribute is defined in the group.booleancontainsAttributeInternal(java.lang.String attributeName)INTERNAL: Return if the attribute is defined in the group.voidconvertClassNamesToClasses(java.lang.ClassLoader classLoader)INTERNAL: Convert all the class-name-based settings in this Descriptor to actual class-based settings.booleanequals(java.lang.Object obj)CoreAttributeGroupfindGroup(DESCRIPTOR type)java.util.Map<java.lang.String,ATTRIBUTE_ITEM>getAllItems()INTERNAL:java.util.Set<java.lang.String>getAttributeNames()CoreAttributeGroupgetGroup(java.lang.String attributeNameOrPath)Returns AttributeGroup corresponding to the passed (possibly nested) attribute.ATTRIBUTE_ITEMgetItem(java.lang.String attributeNameOrPath)INTERNAL: Lookup theAttributeItemfor the provided attribute name or path.java.util.Map<java.lang.String,ATTRIBUTE_ITEM>getItems()INTERNAL:java.lang.StringgetName()java.util.Map<java.lang.Object,CoreAttributeGroup>getSubClassGroups()INTERNAL:java.lang.ClassgetType()java.lang.StringgetTypeName()INTERNAL: Returns the name of the type this group representsbooleanhasInheritance()Indicates whether this group is part of an inheritance hierarchybooleanhasItems()Indicates whether the group has at least one attribute.voidinsertSubClass(CoreAttributeGroup group)INTERNAL: This method will insert the group into the entity hierarchy just below this AttributeGroup.booleanisConcurrent()INTERNAL: Only LoadGroups allow concurrency.booleanisCopyGroup()INTERNAL: This method is used internally when converting to a copy group.booleanisFetchGroup()booleanisLoadGroup()booleanisSupersetOf(CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR> anotherGroup)Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.booleanisValidated()INTERNAL:voidremoveAttribute(java.lang.String attributeNameOrPath)Remove an attribute from the group.voidsetAllSubclasses(java.util.Map<java.lang.Object,CoreAttributeGroup> subclasses)INTERNAL:voidsetAttributeNames(java.util.Set attributeNames)voidsetName(java.lang.String name)java.lang.StringtoString()
-
-
-
Constructor Detail
-
CoreAttributeGroup
public CoreAttributeGroup(java.lang.String name)
-
CoreAttributeGroup
public CoreAttributeGroup(java.lang.String name, java.lang.String type, boolean isValidated)
-
CoreAttributeGroup
public CoreAttributeGroup(java.lang.String name, java.lang.Class type, boolean isValidated)INTERNAL: This constructer is to only be used by EclipseLink internally- Parameters:
name-type-
-
CoreAttributeGroup
public CoreAttributeGroup()
-
-
Method Detail
-
addAttribute
public 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.Example:
group.addAttribute("firstName");
group.addAttribute("manager.address");- Parameters:
attributeNameOrPath- A simple attribute, array or attributes forming a path
-
addAttribute
public void addAttribute(java.lang.String attributeNameOrPath, java.util.Collection<? extends CoreAttributeGroup> groups)Add an attribute and the corresponding list of AttributeGroups. Multiple groups are added in the case of inheritance- Parameters:
attributeNameOrPath- A simple attribute, array or attributes forming a pathgroups- - a collection of AttributeGroups to be added.
-
addAttribute
public void addAttribute(java.lang.String attributeNameOrPath, CoreAttributeGroup 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.
-
addAttributeKey
public void addAttributeKey(java.lang.String attributeNameOrPath, CoreAttributeGroup group)Add a basic attribute or nested attribute with each String representing the key of an attribute of type Map 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 path to a Map keygroup- - an AttributeGroup to be added.
-
addAttributes
public void addAttributes(java.util.Collection<java.lang.String> attrOrPaths)
Add a set of attributes to the group.
-
clone
public CoreAttributeGroup clone()
-
clone
public CoreAttributeGroup clone(java.util.Map<CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>,CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR>> cloneMap)
INTERNAL: This method is used internally in the clone processing.- Parameters:
cloneMap-- Returns:
-
containsAttribute
public boolean containsAttribute(java.lang.String attributeNameOrPath)
Return if the attribute is defined in the group.
-
containsAttributeInternal
public boolean containsAttributeInternal(java.lang.String attributeName)
INTERNAL: Return if the attribute is defined in the group. Only local attribute names are checked.
-
convertClassNamesToClasses
public void convertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this Descriptor to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.- Parameters:
classLoader-
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
findGroup
public CoreAttributeGroup findGroup(DESCRIPTOR type)
-
getAllItems
public java.util.Map<java.lang.String,ATTRIBUTE_ITEM> getAllItems()
INTERNAL:
-
getAttributeNames
public java.util.Set<java.lang.String> getAttributeNames()
-
getGroup
public CoreAttributeGroup getGroup(java.lang.String attributeNameOrPath)
Returns AttributeGroup corresponding to the passed (possibly nested) attribute.
-
getItem
public ATTRIBUTE_ITEM getItem(java.lang.String attributeNameOrPath)
INTERNAL: Lookup theAttributeItemfor the provided attribute name or path.- Returns:
- item or null
- Throws:
java.lang.IllegalArgumentException- if name is not valid attribute name or path
-
getItems
public java.util.Map<java.lang.String,ATTRIBUTE_ITEM> getItems()
INTERNAL:
-
getName
public java.lang.String getName()
-
getSubClassGroups
public java.util.Map<java.lang.Object,CoreAttributeGroup> getSubClassGroups()
INTERNAL:
-
getType
public java.lang.Class getType()
-
getTypeName
public java.lang.String getTypeName()
INTERNAL: Returns the name of the type this group represents
-
hasInheritance
public boolean hasInheritance()
Indicates whether this group is part of an inheritance hierarchy
-
hasItems
public boolean hasItems()
Indicates whether the group has at least one attribute.
-
insertSubClass
public void insertSubClass(CoreAttributeGroup group)
INTERNAL: This method will insert the group into the entity hierarchy just below this AttributeGroup.- Parameters:
group-
-
isConcurrent
public boolean isConcurrent()
INTERNAL: Only LoadGroups allow concurrency.
-
isCopyGroup
public boolean isCopyGroup()
INTERNAL: This method is used internally when converting to a copy group.- Returns:
-
isFetchGroup
public boolean isFetchGroup()
-
isLoadGroup
public boolean isLoadGroup()
-
isSupersetOf
public boolean isSupersetOf(CoreAttributeGroup<ATTRIBUTE_ITEM,DESCRIPTOR> anotherGroup)
Return true if this AttributeGroup is a super-set of the passed in AttributeGroup.
-
isValidated
public boolean isValidated()
INTERNAL:- Returns:
- the isValidated
-
removeAttribute
public void removeAttribute(java.lang.String attributeNameOrPath)
Remove an attribute from the group.
-
setAllSubclasses
public void setAllSubclasses(java.util.Map<java.lang.Object,CoreAttributeGroup> subclasses)
INTERNAL:
-
setAttributeNames
public void setAttributeNames(java.util.Set attributeNames)
-
setName
public void setName(java.lang.String name)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-