Search in sources :

Example 11 with FetchGroupMemberMetaData

use of org.datanucleus.metadata.FetchGroupMemberMetaData in project datanucleus-core by datanucleus.

the class FetchPlanForClass method getFetchGroupsForMemberNumber.

/**
 * Get all the fetch groups where this member number is included.
 * @param fgmds The Fetch Groups
 * @param memberNum the member absolute number
 * @return The Fetch Groups
 */
private Set<FetchGroupMetaData> getFetchGroupsForMemberNumber(Set<FetchGroupMetaData> fgmds, int memberNum) {
    Set<FetchGroupMetaData> fetchGroups = new HashSet();
    if (fgmds != null) {
        for (FetchGroupMetaData fgmd : fgmds) {
            Set<FetchGroupMemberMetaData> subFGmmds = fgmd.getMembers();
            if (subFGmmds != null) {
                for (FetchGroupMemberMetaData subFGmmd : subFGmmds) {
                    if (subFGmmd.getName().equals(cmd.getMetaDataForManagedMemberAtAbsolutePosition(memberNum).getName())) {
                        fetchGroups.add(fgmd);
                    }
                }
            }
            Set<FetchGroupMetaData> subFGmds = fgmd.getFetchGroups();
            if (subFGmds != null) {
                fetchGroups.addAll(getFetchGroupsForMemberNumber(subFGmds, memberNum));
            }
        }
    }
    return fetchGroups;
}
Also used : FetchGroupMemberMetaData(org.datanucleus.metadata.FetchGroupMemberMetaData) FetchGroupMetaData(org.datanucleus.metadata.FetchGroupMetaData) HashSet(java.util.HashSet)

Aggregations

FetchGroupMemberMetaData (org.datanucleus.metadata.FetchGroupMemberMetaData)11 FetchGroupMetaData (org.datanucleus.metadata.FetchGroupMetaData)8 AbstractClassMetaData (org.datanucleus.metadata.AbstractClassMetaData)3 HashSet (java.util.HashSet)2 NucleusUserException (org.datanucleus.exceptions.NucleusUserException)2 ClassMetaData (org.datanucleus.metadata.ClassMetaData)2 ColumnMetaData (org.datanucleus.metadata.ColumnMetaData)2 DiscriminatorMetaData (org.datanucleus.metadata.DiscriminatorMetaData)2 FetchPlanMetaData (org.datanucleus.metadata.FetchPlanMetaData)2 FileMetaData (org.datanucleus.metadata.FileMetaData)2 ForeignKeyMetaData (org.datanucleus.metadata.ForeignKeyMetaData)2 IdentityMetaData (org.datanucleus.metadata.IdentityMetaData)2 IndexMetaData (org.datanucleus.metadata.IndexMetaData)2 InheritanceMetaData (org.datanucleus.metadata.InheritanceMetaData)2 InvalidClassMetaDataException (org.datanucleus.metadata.InvalidClassMetaDataException)2 InvalidMetaDataException (org.datanucleus.metadata.InvalidMetaDataException)2 JoinMetaData (org.datanucleus.metadata.JoinMetaData)2 PrimaryKeyMetaData (org.datanucleus.metadata.PrimaryKeyMetaData)2 BitSet (java.util.BitSet)1 AttributeConverter (javax.jdo.AttributeConverter)1