EOFetchSpecification fs = new EOFetchSpecification(rel.destinationEntity().name(), null, null);
NSMutableArray<EOQualifier> qualifiers = new NSMutableArray(rel.joins().count());
NSDictionary pk = source.primaryKeyForGlobalID(sourceGlobalID);
for (Iterator iterator = rel.joins().iterator(); iterator.hasNext();) {
EOJoin join = (EOJoin) iterator.next();
Object pkValue = pk.objectForKey(join.sourceAttribute().name());
EOKeyValueQualifier qualifier = new EOKeyValueQualifier(join.destinationAttribute().name(), EOQualifier.QualifierOperatorEqual, pkValue);
qualifiers.addObject(qualifier);
}
fs.setQualifier(qualifiers.count() == 1 ? qualifiers.lastObject() : new EOAndQualifier(qualifiers));
value = ec.objectsWithFetchSpecification(fs);