Examples of insertedObjects()


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

      if(object()!=null) {
        EOEditingContext ec = object().editingContext();
        boolean shouldRevert = false;
        try {
          if (object()!=null && validateObject && shouldValidateBeforeSave()) {
            if (ec.insertedObjects().containsObject(object()))
              object().validateForInsert();
            else
              object().validateForUpdate();
          }
            if (object()!=null && shouldSaveChanges() && ec.hasChanges()) {
View Full Code Here

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

            if (ec.parentObjectStore() == ec.rootObjectStore()) {

                String notificationName = n.name();
                if (notificationName.equals(ERXEC.EditingContextWillSaveChangesNotification)) {
                    ec.processRecentChanges();
                    NSArray inserted = ec.insertedObjects();
                    NSArray updated = ec.updatedObjects();
                    updated = ERXArrayUtilities.arrayMinusArray(updated, inserted);
                    NSArray deleted = ec.deletedObjects();

                    Transaction transaction = new Transaction(ec);
View Full Code Here

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

   */
    public boolean hasActualChanges() {
        EOEditingContext ec = editingContext();
        boolean hasChanges = ec.hasChanges();
        if(hasChanges) {
            hasChanges  = ec.insertedObjects().count() > 0;
            hasChanges |= ec.updatedObjects().count() > 0 && ((NSArray)ec.updatedObjects().valueForKeyPath("changesFromCommittedSnapshot.allValues.@flatten")).count() > 0;
            hasChanges |= ec.deletedObjects().count() > 0;
        }
        return hasChanges;
    }
View Full Code Here

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

            if (ec.parentObjectStore() == ec.rootObjectStore()) {

                String notificationName = n.name();
                if (notificationName.equals(ERXEC.EditingContextWillSaveChangesNotification)) {
                    ec.processRecentChanges();
                    NSArray inserted = ec.insertedObjects();
                    NSArray updated = ec.updatedObjects();
                    updated = ERXArrayUtilities.arrayMinusArray(updated, inserted);
                    NSArray deleted = ec.deletedObjects();

                    Transaction transaction = new Transaction(ec);
View Full Code Here

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

        if (configuration.count() == 0)
            return;
        EOEditingContext ec = (EOEditingContext) n.object();
        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())) {
View Full Code Here

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

    EOEditingContext ec = ERXEC.newEditingContext();
    Company co = ERXEOControlUtilities.createAndInsertObject(ec, Company.class);
    //Only testing for nullness since the above should throw a class cast ex if
    //co is not a company.
    Assert.assertNotNull(co);
    Assert.assertTrue(ec.insertedObjects().contains(co));
  }

  public void testRootEntity() {
    EOEditingContext ec = ERXEC.newEditingContext();
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.