for (Enumeration e = entities.objectEnumerator(); e.hasMoreElements();) {
EOEntity entity = (EOEntity)e.nextElement();
/* For EOs that are completely shared the below for loop results in *2* fetches
for 1 fs (fetchAll) when the entity is caching the code below works around this with only 1 fetch. */
if (entity.sharedObjectFetchSpecificationNames().count() == 1 &&
entity.sharedObjectFetchSpecificationNames().lastObject().equals("FetchAll")) {
try {
EOFetchSpecification fs = entity.fetchSpecificationNamed("FetchAll");
dsec.bindObjectsWithFetchSpecification(fs, "FetchAll");
} catch (Exception e1) {
log.error("Exception occurred for entity named: " + entity.name() + " in Model: " + aModel.name() + e1);