All Implemented Interfaces:
Serializable, Cloneable

public class EntityFetchGroup extends FetchGroup
EntityFetchGroup reflects the state of the object. Because EntityFetchGroup doesn't attempt to track the state of related objects it is flat (non-nested).
Since:
EclipseLink 2.1
See Also:
  • Constructor Details

    • EntityFetchGroup

      protected EntityFetchGroup()
    • EntityFetchGroup

      public EntityFetchGroup(FetchGroup fetchGroup)
    • EntityFetchGroup

      public EntityFetchGroup(String attributeName)
    • EntityFetchGroup

      public EntityFetchGroup(Collection<String> attributeNames)
    • EntityFetchGroup

      public EntityFetchGroup(String[] attributeNames)
    • EntityFetchGroup

      public EntityFetchGroup(FetchGroup fetchGroup, String attributeName)
  • Method Details

    • addAttribute

      public void addAttribute(String attributeNameOrPath, CoreAttributeGroup group)
      Description copied from class: CoreAttributeGroup
      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.

      Overrides:
      addAttribute in class FetchGroup
      Parameters:
      attributeNameOrPath - A simple attribute, array or attributes forming a path
      group - - an AttributeGroup to be added.
    • onUnfetchedAttribute

      public String onUnfetchedAttribute(FetchGroupTracker entity, String attributeName)
      Called on attempt to get value of an attribute that hasn't been fetched yet. Returns an error message in case exception should be thrown by the calling method, null otherwise.
      Overrides:
      onUnfetchedAttribute in class FetchGroup
    • onUnfetchedAttributeForSet

      public String onUnfetchedAttributeForSet(FetchGroupTracker entity, String attributeName)
      Called on attempt to assign value to an attribute that hasn't been fetched yet. Returns an error message in case exception should be thrown by the calling method, null otherwise.
      Overrides:
      onUnfetchedAttributeForSet in class FetchGroup
    • removeAttribute

      public void removeAttribute(String attributeNameOrPath)
      Description copied from class: CoreAttributeGroup
      Remove an attribute from the group.
      Overrides:
      removeAttribute in class CoreAttributeGroup<AttributeItem,ClassDescriptor>
    • setOnEntity

      public void setOnEntity(Object entity, AbstractSession session)
      Set this EntityFetchGroup on an entity implementing FetchGroupTracker.
    • isEntityFetchGroup

      public boolean isEntityFetchGroup()
      Overrides:
      isEntityFetchGroup in class FetchGroup
    • isSupersetOf

      public boolean isSupersetOf(CoreAttributeGroup anotherGroup)
      Return true if this EntityFetchGroup is a super-set of the passed in EntityFetchGroup.
      Overrides:
      isSupersetOf in class CoreAttributeGroup<AttributeItem,ClassDescriptor>