Package com.webobjects.eocontrol

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


        Employee e = (Employee) EOUtilities.createAndInsertInstance(nested, Employee.ENTITY_NAME);
        e.setFirstName("First");
        e.setLastName("Last");
        e.setManager(Boolean.FALSE);
        e.addObjectToBothSidesOfRelationshipWithKey(nestC, Employee.COMPANY_KEY);
        nested.saveChanges();
        ec.saveChanges();
        System.gc();
        c.delete();
        ec.saveChanges();
      } catch (Exception e) {
View Full Code Here


    EOEditingContext ec2 = (EOEditingContext) object;
   
    Assert.assertNotSame(ec, ec2);
    ec.dispose();
    ec2.saveChanges();
    }

  /**
   * Test method for {@link er.extensions.eof.ERXEC#finalize()}.
   */
 
View Full Code Here

      EOEditingContext ec = editingContext();

      ec.lock();
      EOEnterpriseObject company = EOUtilities.createAndInsertInstance(ec, "Company");
      company.takeValueForKey("SomeBody.com", "name");
      ec.saveChanges();
      ec.unlock();

      start();

      String lastName = Thread.currentThread().getName() + System.currentTimeMillis() + "Person";
View Full Code Here

        eo.takeValueForKey("Bob" + idx, "name");
        eo.takeValueForKey(lastName, "state");
        ec.unlock();
      }
      ec.lock();
      ec.saveChanges();
      ec.unlock();

      ec.lock();
      NSArray rowsInserted = EOUtilities.objectsMatchingKeyAndValue(ec, "Employee", "state", lastName);
      boolean insertOk = (rowsInserted.count() == iters);
View Full Code Here

      boolean insertOk = (rowsInserted.count() == iters);

      for (int idx = 0; idx < iters; idx++) {
        ec.deleteObject((EOEnterpriseObject) rowsInserted.get(idx));
      }
      ec.saveChanges();
      ec.unlock();

      ec.lock();
      NSArray rowsDeleted = EOUtilities.objectsMatchingKeyAndValue(ec, "Employee", "state", lastName);
      ec.unlock();
View Full Code Here

      boolean deleteOk = (rowsDeleted.count() == 0);

      ec.lock();
      ec.deleteObject(company);
      ec.saveChanges();
      ec.unlock();

      end();

      print("RESULT", ((insertOk && deleteOk) ? "OK" : "FAILED"));
View Full Code Here

  public void testFetchLimit() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
    for (int i = 0; i < 10; i++) {
      Company.createCompany(editingContext, "Test Company " + i);
    }
    editingContext.saveChanges();
    EOFetchSpecification fetchSpec = new EOFetchSpecification("Company", null, null);
    fetchSpec.setFetchLimit(1);
    NSArray companies = editingContext.objectsWithFetchSpecification(fetchSpec);
    assertEquals(1, companies.size());
  }
View Full Code Here

  public void testFetchLimitWithSortOrder() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
    for (int i = 0; i < 10; i++) {
      Company.createCompany(editingContext, "Test Company " + i);
    }
    editingContext.saveChanges();
    EOFetchSpecification fetchSpec = new EOFetchSpecification("Company", null, Company.NAME.descs());
    fetchSpec.setFetchLimit(1);
    NSArray<Company> companies = editingContext.objectsWithFetchSpecification(fetchSpec);
    assertEquals(1, companies.size());
    assertEquals("Test Company 9", companies.objectAtIndex(0).name());
View Full Code Here

    NSMutableArray<Company> companies = new NSMutableArray<Company>();
    for (int i = 0; i < 10; i++) {
      Company c = Company.createCompany(editingContext, "Test Company " + i);
      companies.addObject(c);
    }
    editingContext.saveChanges();

    for (Company c : companies) {
      c.delete();
      editingContext.saveChanges();
    }
View Full Code Here

    }
    editingContext.saveChanges();

    for (Company c : companies) {
      c.delete();
      editingContext.saveChanges();
    }
  }
 
  public void testSnapshot() {
    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.