Class FetchGroupMetaData

java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.FetchGroupMetaData
All Implemented Interfaces:
Serializable

public class FetchGroupMetaData extends MetaData
A fetch group defines a particular loaded state for an object graph. It specifies fields/properties to be loaded for all of the instances in the graph when this fetch group is active.
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • postLoad

      boolean postLoad
      The post-load attribute on the fetch-group element indicates whether the jdoPostLoad callback will be made when the fetch group is loaded. It defaults to false, for all fetch groups except the default fetch group, on which it defaults to true.
    • name

      final String name
      The name attribute on a field element contained within a fetch-group element is the name of field in the enclosing class or a dot-separated expression identifying a field reachable from the class by navigating a reference, collection or map. For maps of persistable classes "#key" or "#value" may be appended to the name of the map field to navigate the key or value respectively (e.g. to include a field of the key class or value class in the fetch group). For collection and arrays of persistence-capable classes, "#element" may be appended to the name of the field to navigate the element. This is optional; if omitted for collections and arrays, #element is assumed.
    • fetchGroups

      protected Set<FetchGroupMetaData> fetchGroups
      A contained fetch-group element indicates that the named group is to be included in the group being defined. Nested fetch group elements are limited to only the name attribute.
    • members

      protected Set<FetchGroupMemberMetaData> members
      members (fields/properties) declared to be in this fetch group.
  • Constructor Details

    • FetchGroupMetaData

      public FetchGroupMetaData(String name)
      Constructor for a named fetch group. Set fields using setters, before populate().
      Parameters:
      name - Name of fetch group
  • Method Details

    • getName

      public final String getName()
    • getPostLoad

      public final Boolean getPostLoad()
    • setPostLoad

      public FetchGroupMetaData setPostLoad(Boolean postLoad)
    • getFetchGroups

      public final Set<FetchGroupMetaData> getFetchGroups()
    • getMembers

      public final Set<FetchGroupMemberMetaData> getMembers()
      Accessor for metadata for the members of this group.
      Returns:
      Returns the metadata for members
    • getNumberOfMembers

      public int getNumberOfMembers()
    • addFetchGroup

      public void addFetchGroup(FetchGroupMetaData fgmd)
      Add a new FetchGroupMetaData
      Parameters:
      fgmd - the fetch group
    • addMember

      public void addMember(FetchGroupMemberMetaData fgmmd)
      Add a new field/property.
      Parameters:
      fgmmd - the field/property metadata
    • newMemberMetaData

      public FetchGroupMemberMetaData newMemberMetaData(String name)
      Method to create a new member, add it, and return it.
      Parameters:
      name - The name of the fetch group
      Returns:
      The field metadata