Class EntityFetchGroup

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.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
    Author:
    dclarke, ailitchev
    See Also:
    Serialized Form
    • Constructor Detail

      • EntityFetchGroup

        protected EntityFetchGroup()
      • EntityFetchGroup

        public EntityFetchGroup​(FetchGroup fetchGroup)
      • EntityFetchGroup

        public EntityFetchGroup​(java.lang.String attributeName)
      • EntityFetchGroup

        public EntityFetchGroup​(java.util.Collection<java.lang.String> attributeNames)
      • EntityFetchGroup

        public EntityFetchGroup​(java.lang.String[] attributeNames)
      • EntityFetchGroup

        public EntityFetchGroup​(FetchGroup fetchGroup,
                                java.lang.String attributeName)
    • Method Detail

      • addAttribute

        public void addAttribute​(java.lang.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 java.lang.String onUnfetchedAttribute​(FetchGroupTracker entity,
                                                     java.lang.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 java.lang.String onUnfetchedAttributeForSet​(FetchGroupTracker entity,
                                                           java.lang.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
      • setOnEntity

        public void setOnEntity​(java.lang.Object entity,
                                AbstractSession session)
        Set this EntityFetchGroup on an entity implementing FetchGroupTracker.