Examples of company()


Examples of er.erxtest.model.Employee.company()

    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    p1.setCompanyRelationship(company);

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

  public void testAddToToManyImplicitToOne() {
View Full Code Here

Examples of er.erxtest.model.Employee.company()

    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    company.addToEmployeesRelationship(p1);

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

  public void testAutoSetToOneImplicitToMany() {
View Full Code Here

Examples of er.erxtest.model.Employee.company()

    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    p1.setCompany(company);

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

  public void testAutoAddToToManyImplicitToOne() {
View Full Code Here

Examples of er.erxtest.model.Employee.company()

    EOEditingContext editingContext = ERXEC.newEditingContext();
    Company company = Company.createCompany(editingContext, "XYZ");
    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() {
View Full Code Here

Examples of er.erxtest.model.Employee.company()

    Company company = Company.createCompany(editingContext, "XYZ");
    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();
View Full Code Here

Examples of er.erxtest.model.Employee.company()

    Company company2 = Company.createCompany(editingContext, "XYZ");
    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    p1.setCompany(company);
    p1.setCompany(company2);

    assertEquals(company2, p1.company());
    assertEquals(0, company.employees().count());
    assertEquals(1, company2.employees().count());
    assertEquals(p1, company2.employees().objectAtIndex(0));
  }
View Full Code Here

Examples of er.erxtest.model.Employee.company()

    Company company = Company.createCompany(editingContext, "XYZ");
    Employee p1 = (Employee) EOUtilities.createAndInsertInstance(editingContext, Employee.ENTITY_NAME);
    company.addToEmployees(p1);
    company.removeFromEmployees(p1);

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

  public void testAutoSetTwoToOnesImplicitToMany() {
    EOEditingContext editingContext = ERXEC.newEditingContext();
View Full Code Here

Examples of er.erxtest.model.Employee.company()

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

    assertEquals(company, p1.company());
    assertEquals(company, p2.company());
    assertEquals(2, company.employees().count());
    assertTrue(company.employees().containsObject(p1));
    assertTrue(company.employees().containsObject(p2));
  }
View Full Code Here

Examples of er.erxtest.model.Employee.company()

    company.addToEmployees(p1);
    company.addToEmployees(p2);
    company.removeFromEmployees(p1);

    assertEquals(null, p1.company());
    assertEquals(company, p2.company());
    assertEquals(1, company.employees().count());
    assertEquals(p2, company.employees().objectAtIndex(0));
  }
 
  public void testRevertToManyWithoutInverseRelationshipUpdating() {
View Full Code Here

Examples of er.erxtest.model.Employee.company()

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

    assertEquals(company, p1.company());
    assertEquals(1, company.employees().count());
    assertEquals(p1, company.employees().objectAtIndex(0));
   
    editingContext.revert();
   
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.