EOAttribute attribute = relationship.sourceAttributes().lastObject();
EODatabaseContext context = EOUtilities.databaseContextForModelNamed(ec, entity.model().name());
String name = attribute.name();
for (Enumeration e = eos.objectEnumerator(); e.hasMoreElements();) {
EOEnterpriseObject target = (EOEnterpriseObject) e.nextElement();
Object value = (context.snapshotForGlobalID(ec.globalIDForObject(target))).valueForKey(name);
result.addObject(value);
}
} else {
throw new IllegalArgumentException("Has more than one relationship attribute: " + relKey);
}