EOEnterpriseObject newEO = ERXEOControlUtilities.createAndInsertObject(localContext, entityNameForNewInstances);
// If the object already exists, then hookup the relationship, if not do it after the object is saved.
if (!((ERXEnterpriseObject)object).isNewObject()) {
EOEnterpriseObject localEO = EOUtilities.localInstanceOfObject(localContext, object);
if (localEO != null)
localEO.addObjectToBothSidesOfRelationshipWithKey(newEO, key);
}
if (preRelationshipKeys != null) {
for(Enumeration e = preRelationshipKeys.allKeys().objectEnumerator(); e.hasMoreElements();) {
String relationshipKey = (String)e.nextElement();
String objectKeyPath = (String)preRelationshipKeys.objectForKey(relationshipKey);