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;
}
Aggregations