org.eclipse.persistence.queries

Class FetchGroup

    • Constructor Detail

      • FetchGroup

        public FetchGroup()
      • FetchGroup

        public FetchGroup(java.lang.String name)
    • Method Detail

      • getAttributes

        @Deprecated
        public java.util.Set<java.lang.String> getAttributes()
        Return the attribute names on the current FetchGroup. This does not include the attributes on nested FetchGroups
      • onUnfetchedAttribute

        public java.lang.String onUnfetchedAttribute(FetchGroupTracker entity,
                                            java.lang.String attributeName)
        INTERNAL: Called on attempt to get value of an attribute that hasn't been fetched yet. Returns an error message in case javax.persistence.EntityNotFoundException should be thrown by the calling method, null otherwise.

        This method is typically only invoked through woven code in the persistence object introduced when FetchGroupTracker is woven into the entity.

      • onUnfetchedAttributeForSet

        public java.lang.String onUnfetchedAttributeForSet(FetchGroupTracker entity,
                                                  java.lang.String attributeName)
        INTERNAL: Called on attempt to assign value to an attribute that hasn't been fetched yet. Returns an error message in case javax.persistence.EntityNotFoundException should be thrown by the calling method, null otherwise.

        This method is typically only invoked through woven code in the persistence object introduced when FetchGroupTracker is woven into the entity.

      • getRootEntity

        public FetchGroupTracker getRootEntity()
        INTERNAL:
        Returns:
        the rootEntity
      • setRootEntity

        public void setRootEntity(FetchGroupTracker rootEntity)
        INTERNAL:
        Parameters:
        rootEntity - the rootEntity to set
      • setShouldLoad

        public void setShouldLoad(boolean shouldLoad)
        Configure this group to also act as a LoadGroup when set to true and load all of the specified relationships so that the entities returned from the query where this group was used have the requested relationships populated. All subsequent attributes added to this group that create a nested group will have this value applied to them.
        See Also:
        to configure {@link #shouldLoad()} on nested groups
      • shouldLoad

        public boolean shouldLoad()
        Returns:
        true if this group will be used as a LoadGroupwhen processing the results of a query to force the specified relationships to be loaded.
      • isEntityFetchGroup

        public boolean isEntityFetchGroup()
      • toLoadGroupLoadOnly

        public LoadGroup toLoadGroupLoadOnly()
      • getEntityFetchGroup

        public EntityFetchGroup getEntityFetchGroup(FetchGroupManager fetchGroupManager)
        INTERNAL: Used to retrieve the EntityFetchGroup for this FetchGroup
        Returns:
        the entityFetchGroup
      • getGroup

        public FetchGroup getGroup(java.lang.String attributeNameOrPath)
        Returns FetchGroup corresponding to the passed (possibly nested) attribute.
        Overrides:
        getGroup in class AttributeGroup
      • addAttribute

        public void addAttribute(java.lang.String attributeNameOrPath,
                        AttributeGroup group)
        Description copied from class: AttributeGroup
        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 AttributeGroup
        group - - an AttributeGroup to be added.
      • addAttribute

        public void addAttribute(java.lang.String attributeNameOrPath,
                        java.util.Collection<AttributeGroup> groups)
        Description copied from class: AttributeGroup
        Add an attribute and the corresponding list of AttributeGroups. Multiple groups are added in the case of inheritance

        Overrides:
        addAttribute in class AttributeGroup
      • addAttributeKey

        public void addAttributeKey(java.lang.String attributeNameOrPath,
                           AttributeGroup group)
        Description copied from class: AttributeGroup
        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);
        group.addAttribute("manager.address", group2);
        Note that existing group corresponding to attributeNameOrPath will be overridden with the passed group.

        Overrides:
        addAttributeKey in class AttributeGroup
        group - - an AttributeGroup to be added.

EclipseLink 2.4.2, "build v20130514-5956486" API Reference