String keypath = (String) keyPaths.nextElement();
EORelationship relationship = entity.relationshipNamed(keypath);
EODatabaseContext dbc = ERXEOAccessUtilities.databaseContextForEntityNamed((EOObjectStoreCoordinator) ec.rootObjectStore(), entityName);
dbc.lock();
try {
dbc.batchFetchRelationship(relationship, objects, ec);
} finally {
dbc.unlock();
}
}
}