Class AttributeGroup

  • All Implemented Interfaces:
    Serializable, Cloneable
    Direct Known Subclasses:
    CopyGroup, FetchGroup, LoadGroup

    public class AttributeGroup
    extends CoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,​ClassDescriptor>
    implements Serializable, 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
    EclipseLink 2.1
    • Constructor Detail

      • AttributeGroup

        public AttributeGroup​(String name)
      • AttributeGroup

        public AttributeGroup​(String name,
                              Class type,
                              boolean isValidated)
        INTERNAL: This constructer is to only be used by EclipseLink internally
        name -
        type -
      • AttributeGroup

        public AttributeGroup​(String name,
                              String type,
                              boolean isValidated)
      • AttributeGroup

        public AttributeGroup()
    • Method Detail

      • addAttribute

        public 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.

        Example: group.addAttribute("firstName", group1);
        group.addAttribute("manager.address", group2);
        Note that existing group corresponding to attributeNameOrPath will be overridden with the passed group.

        attributeNameOrPath - A simple attribute, array or attributes forming a path
        group - - an AttributeGroup to be added.
      • 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​(String attributeNameOrPath)
        INTERNAL: Lookup the AttributeItemfor the provided attribute name or path.
        getItem in class CoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,​ClassDescriptor>
        item or null
        IllegalArgumentException - if name is not valid attribute name or path
      • newItem

        protected org.eclipse.persistence.internal.queries.AttributeItem newItem​(AttributeGroup group,
                                                                                 String attrName)
        Subclass may create different types.
      • toFetchGroup

        public FetchGroup toFetchGroup()
        Convert the group to a FetchGroup for usage with queries.
      • toFetchGroup

        public FetchGroup toFetchGroup​(Map<AttributeGroup,​FetchGroup> cloneMap)
        INTERNAL: This method is used internally when converting to a copy group.
        cloneMap -
      • isCopyGroup

        public boolean isCopyGroup()
        INTERNAL: This method is used internally when converting to a copy group.
        isCopyGroup in class CoreAttributeGroup<org.eclipse.persistence.internal.queries.AttributeItem,​ClassDescriptor>
      • toCopyGroup

        public CopyGroup toCopyGroup()
        Convert the group to a CopyGroup for usage with the copy() API.
      • toCopyGroup

        public CopyGroup toCopyGroup​(Map<AttributeGroup,​CopyGroup> cloneMap,
                                     Map copies)
        INTERNAL: This method is used internally when converting to a copy group.
        cloneMap -
      • toLoadGroup

        public LoadGroup toLoadGroup()
        Convert the group to a LoadGroup for usage with queries.