Package com.webobjects.eocontrol

Examples of com.webobjects.eocontrol.EOEditingContext.deleteObject()


            for(Enumeration e = relatedObjects.immutableClone().objectEnumerator(); e.hasMoreElements(); ) {
                EOEnterpriseObject relatedObject = (EOEnterpriseObject)e.nextElement();
                EOEnterpriseObject pickedObject = (EOEnterpriseObject)relatedObject.valueForKey(pickRelationshipName);
                if(!selectedObjects.containsObject(pickedObject)) {
                    eo.removeObjectFromBothSidesOfRelationshipWithKey(relatedObject, relationshipName);
                    ec.deleteObject(relatedObject);
                }
            }
            NSArray pickedObjects = (NSArray)eo.valueForKeyPath(relationshipName +"." + pickRelationshipName +".@unique");
            EOEntity entity = ERXEOAccessUtilities.destinationEntityForKeyPath(ERXEOAccessUtilities.entityForEo(eo), relationshipName);
            for(Enumeration e = selectedObjects.objectEnumerator(); e.hasMoreElements(); ) {
View Full Code Here


                    EOEditingContext ec = ERXEC.newEditingContext();
                    ec.lock();
                    try {
                        ec.setSharedEditingContext(null);
                        EOEnterpriseObject object = EOUtilities.localInstanceOfObject(ec, _object);
                        ec.deleteObject(object);
                        ec.saveChanges();
                    } finally {
                        ec.unlock();
                        ec.dispose();
                    }
View Full Code Here

                  //Place the EO into a nested ec and try to delete there
                  //to prevent the appearance of a successful delete if
                  //validation fails.
                  EOEnterpriseObject eo = ERXEOControlUtilities.editableInstanceOfObject(_object, true);
                  EOEditingContext childEC = eo.editingContext();
                  childEC.deleteObject(eo);
                  childEC.saveChanges();
                 
                    if (ERXEOControlUtilities.isNewObject(_object)) {
                        // This is necessary to force state synching, e.g., for display groups, etc.
                        editingContext.processRecentChanges();
View Full Code Here

        anObject.takeValueForKey((System.getProperty("user.home") + File.separator + "FSItemInsertTest"), "absolutePath");

        anEditingContext.insertObject(anObject);
        anEditingContext.saveChanges();

        anEditingContext.deleteObject(anObject);
        anEditingContext.saveChanges();
    }
}
View Full Code Here

                    EOEditingContext ec = ERXEC.newEditingContext();
                    ec.lock();
                    try {
                        ec.setSharedEditingContext(null);
                        EOEnterpriseObject object = EOUtilities.localInstanceOfObject(ec, object());
                        ec.deleteObject(object);
                        ec.saveChanges();
                    } finally {
                        ec.unlock();
                        ec.dispose();
                    }
View Full Code Here

          entity.relationshipNamed(relationshipName);
          ERXCopyable.copyLogger.debug("Removing objects in to-many relationship " + relationshipName);
          for (ERXEnterpriseObject relatedObject : relatedObjects) {
            destination.removeObjectFromBothSidesOfRelationshipWithKey(relatedObject, relationshipName);
            if (relatedObject.isNewObject()) {
              editingContext.deleteObject(relatedObject);
            }
          }
        }
      }
View Full Code Here

                    EOEditingContext ec = ERXEC.newEditingContext();
                    ec.lock();
                    try {
                        ec.setSharedEditingContext(null);
                        EOEnterpriseObject object = EOUtilities.localInstanceOfObject(ec, object());
                        ec.deleteObject(object);
                        ec.saveChanges();
                    } finally {
                        ec.unlock();
                        ec.dispose();
                    }
View Full Code Here

  public WOActionResults uploadSucceededAction() {

    EOEditingContext workingEC = masterObject().editingContext();
    ERAttachment existing = (ERAttachment)masterObject().valueForKey(relationshipKey());
    if (existing != null) {
      workingEC.deleteObject(existing.localInstanceIn(workingEC));
    }
    masterObject().addObjectToBothSidesOfRelationshipWithKey(newAttachment(), relationshipKey());
   
    _showUpload = false;
    return (WOActionResults)valueForBinding(Keys.uploadSucceededAction);
View Full Code Here

        if (ec.parentObjectStore() instanceof EOObjectStoreCoordinator) {
            ec.processRecentChanges();
            NSArray<EOEnterpriseObject> insertedObjects = ec.insertedObjects().immutableClone();
            for (EOEnterpriseObject eo : insertedObjects) {
                if(ERCAuditTrailEntry.clazz.entityName().equals(eo.entityName())) {
                    ec.deleteObject(eo);
                }
                if(ERCAuditTrail.clazz.entityName().equals(eo.entityName())) {
                    ec.deleteObject(eo);
                }
            }
View Full Code Here

            for (EOEnterpriseObject eo : insertedObjects) {
                if(ERCAuditTrailEntry.clazz.entityName().equals(eo.entityName())) {
                    ec.deleteObject(eo);
                }
                if(ERCAuditTrail.clazz.entityName().equals(eo.entityName())) {
                    ec.deleteObject(eo);
                }
            }
            ec.processRecentChanges();
            NSArray updatedObjects = ec.updatedObjects();
            NSArray deletedObjects = ec.deletedObjects();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.