Examples of employees()


Examples of er.erxtest.model.Company.employees()

    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    company.addToEmployees(p1);

    assertEquals(company, p1.company());
    assertEquals(1, company.employees().count());
    assertEquals(p1, company.employees().objectAtIndex(0));
  }

  public void testAutoSetThenSetToOneToNullImplicitToMany() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
View Full Code Here

Examples of er.erxtest.model.Company.employees()

    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    p1.setCompany(company);
    p1.setCompany(null);
  
    assertEquals(null, p1.company());
    assertEquals(0, company.employees().count());
  }

  public void testAutoSetThenSetToOneToAnotherImplicitToMany() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
View Full Code Here

Examples of er.erxtest.model.Company.employees()

        assertEquals(
            "The attribute named 'address1' in the entity named 'Company' is not a toMany relationship! Expected an NSArray, but got null.",
            exception.getMessage());
      }

      e = c.employees().objectAtIndex(0);

      EOGlobalID eGid = ec.globalIDForObject(e);
      try {
        // Company is not null
        count = ERXEOControlUtilities.objectCountForToManyRelationship(e, Employee.COMPANY_KEY);
View Full Code Here

Examples of er.rest.model.Company.employees()

        try {
            Company c = (Company) ERXRestFormat.json().parse("{\"type\":\"Company\",\"name\":\"Company\",\"revenue\":100}").createObjectWithFilter(null, ERXKeyFilter.filterWithAll(), new ERXRestContext(editingContext));
            assertTrue(editingContext.globalIDForObject(c).isTemporary());
            assertEquals("Company", c.name());
            assertEquals(100.0, c.revenue().doubleValue());
            assertEquals(0, c.employees().count());
        }
        finally {
            editingContext.unlock();
            editingContext.dispose();
        }
View Full Code Here

Examples of er.rest.model.Company.employees()

        try {
            Company c = (Company) ERXRestFormat.json().parse("{\"type\":\"Company\",\"name\":\"Company\",\"revenue\":100,\"employees\":[{\"type\":\"Person\",\"age\":10,\"name\":\"Mike\",\"salary\":null}]}").createObjectWithFilter(null, ERXKeyFilter.filterWithAllRecursive(), new ERXRestContext(editingContext));
            assertTrue(editingContext.globalIDForObject(c).isTemporary());
            assertEquals("Company", c.name());
            assertEquals(100.0, c.revenue().doubleValue());
            NSArray<Person> employees = c.employees();
            assertEquals(1, employees.count());
            Person p = employees.objectAtIndex(0);
            assertTrue(editingContext.globalIDForObject(p).isTemporary());
            assertEquals("Mike", p.name());
            assertEquals(10, p.age().intValue());
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.