org.datanucleus.metadata
Class FetchGroupMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.FetchGroupMetaData
All Implemented Interfaces:
java.io.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:
Serialized Form

Field Summary
protected  FetchGroupMetaData[] fetchGroupMetaData
          A contained fetch-group element indicates that the named group is to be included in the group being defined.
protected  java.util.List<FetchGroupMetaData> fetchGroups
          A contained fetch-group element indicates that the named group is to be included in the group being defined.
protected  AbstractMemberMetaData[] memberMetaData
          members declared to be in this fetch group.
protected  java.util.List<AbstractMemberMetaData> members
          members (fields/properties) declared to be in this fetch group.
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
FetchGroupMetaData(java.lang.String name)
          Constructor for a named fetch group.
 
Method Summary
 void addFetchGroup(FetchGroupMetaData fgmd)
          Add a new FetchGroupMetaData
 void addMember(AbstractMemberMetaData mmd)
          Add a new field/property.
 FetchGroupMetaData[] getFetchGroupMetaData()
          Accessor for fetchGroupMetaData
 AbstractMemberMetaData[] getMemberMetaData()
          Accessor for metadata for the members of this group.
 java.lang.String getName()
           
 int getNumberOfMembers()
           
 java.lang.Boolean getPostLoad()
           
 void initialise(ClassLoaderResolver clr, MetaDataManager mmgr)
          Initialisation method.
 FieldMetaData newFieldMetaData(java.lang.String name)
          Method to create a new field, add it, and return it.
 PropertyMetaData newPropertyMetaData(java.lang.String name)
          Method to create a new property, add it, and return it.
 FetchGroupMetaData setPostLoad(java.lang.Boolean postLoad)
           
 FetchGroupMetaData setPostLoad(java.lang.String postLoad)
           
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object.
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fetchGroupMetaData

protected FetchGroupMetaData[] fetchGroupMetaData
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.


memberMetaData

protected AbstractMemberMetaData[] memberMetaData
members declared to be in this fetch group.


fetchGroups

protected java.util.List<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 java.util.List<AbstractMemberMetaData> members
members (fields/properties) declared to be in this fetch group.

Constructor Detail

FetchGroupMetaData

public FetchGroupMetaData(java.lang.String name)
Constructor for a named fetch group. Set fields using setters, before populate().

Parameters:
name - Name of fetch group
Method Detail

initialise

public void initialise(ClassLoaderResolver clr,
                       MetaDataManager mmgr)
Initialisation method. This should be called AFTER using the populate method if you are going to use populate. It creates the internal convenience arrays etc needed for normal operation.

Overrides:
initialise in class MetaData

getName

public final java.lang.String getName()

getPostLoad

public final java.lang.Boolean getPostLoad()

setPostLoad

public FetchGroupMetaData setPostLoad(java.lang.Boolean postLoad)

setPostLoad

public FetchGroupMetaData setPostLoad(java.lang.String postLoad)

getFetchGroupMetaData

public final FetchGroupMetaData[] getFetchGroupMetaData()
Accessor for fetchGroupMetaData

Returns:
Returns the fetchGroupMetaData.

getMemberMetaData

public final AbstractMemberMetaData[] getMemberMetaData()
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(AbstractMemberMetaData mmd)
Add a new field/property.

Parameters:
mmd - the field/property metadata

newFieldMetaData

public FieldMetaData newFieldMetaData(java.lang.String name)
Method to create a new field, add it, and return it.

Returns:
The field metadata

newPropertyMetaData

public PropertyMetaData newPropertyMetaData(java.lang.String name)
Method to create a new property, add it, and return it.

Returns:
The property metadata

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object. This can be used as part of a facility to output a MetaData file.

Overrides:
toString in class MetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © 2010. All Rights Reserved.