Class FetchGroup

  • All Implemented Interfaces:
    Serializable

    public class FetchGroup
    extends Object
    implements Serializable
    Captures fetch group meta-data. Fetch Group is identified and referred by its immutable name. Fetch Group can nest other groups. The nested group reference is the name of the nested group. Defines two standard fetch group named default and all.
    See Also:
    Serialized Form
    • Method Detail

      • getName

        public String getName()
        Fetch group name.
      • addDeclaredInclude

        public void addDeclaredInclude​(String fgName)
        Includes given fetch group within this receiver.
      • includes

        public boolean includes​(String fgName,
                                boolean recurse)
        Affirms if given fetch group is included by this receiver. Includes superclass definition of fetch group and optionally other included groups.
        Parameters:
        recurse - if true then recursively checks within the included fecth groups
      • addContainedBy

        public boolean addContainedBy​(FetchGroup parent)
        Adds this receiver as one of the included fetch groups of the given parent. The parent fetch group will include this receiver as a side-effect of this call.
        Returns:
        true if given parent is a new addition. false othrwise.
        Since:
        1.1.0
        See Also:
        includes(String, boolean), addDeclaredInclude(String)
      • getContainedBy

        public Set<String> getContainedBy()
        Gets the name of the fetch groups in which this receiver has been included.
        Since:
        1.1.0
        See Also:
        addContainedBy(FetchGroup)
      • getDeclaredIncludes

        public String[] getDeclaredIncludes()
        Return the fetch group names declared included by this group.
      • setRecursionDepth

        public void setRecursionDepth​(FieldMetaData fm,
                                      int depth)
        Recursion depth for the given field. This is the depth of relations of the same class as this one we can fetch through the given field.
      • getRecursionDepth

        public int getRecursionDepth​(FieldMetaData fm)
        Recursion depth for the given field. This is the depth of relations of the same class as this one we can fetch through the given field.
      • getDeclaredRecursionDepth

        public int getDeclaredRecursionDepth​(FieldMetaData fm)
        Return the recursion depth declared for the given field, or 0 if none.
      • getDeclaredRecursionDepthFields

        public FieldMetaData[] getDeclaredRecursionDepthFields()
        Return the fields with declared recursion depths in this group.
      • setPostLoad

        public void setPostLoad​(boolean flag)
        Whether loading this fetch group causes a post-load callback on the loaded instance.
      • isPostLoad

        public boolean isPostLoad()
        Whether loading this fetch group causes a post-load callback on the loaded instance.
      • isPostLoadExplicit

        public boolean isPostLoadExplicit()
        Whether the post-load value is declared for this group.
      • resolve

        public void resolve()
        Resolve and validate fetch group meta-data.
      • equals

        public boolean equals​(Object other)
        Affirms equality if the other has the same name and declaring type.
        Overrides:
        equals in class Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object