Package er.uber.model

Examples of er.uber.model.Company


    employeeTable.addForeignKey("companyID", "Company", "id");
    employeeTable.addForeignKey("photoID", "ERAttachment", "id");
  }

  public void postUpgrade(EOEditingContext editingContext, EOModel model) throws Throwable {
    Company c1 = Company.createCompany(editingContext, "ABC Corp");
    c1.setLocation("Richmond, VA");
    Employee c1e1 = Employee.createEmployee(editingContext, Boolean.TRUE, "Johnny", new NSTimestamp(2008, 1, 15, 6, 30, 0, TimeZone.getDefault()), Boolean.TRUE, "Boss", EmployeeStatus.Available, c1);
    c1e1.setSalary(new BigDecimal("1000000.00"));
    c1e1.setExemptions(Integer.valueOf(2));
    c1e1.taggable().addTagNamed("employee");
    c1e1.taggable().addTagNamed("boss");
    Employee c1e2 = Employee.createEmployee(editingContext, Boolean.FALSE, "Bill", new NSTimestamp(2004, 11, 15, 6, 30, 0, TimeZone.getDefault()), Boolean.FALSE, "Employee", EmployeeStatus.Available, c1);
    c1e2.setSalary(new BigDecimal("50.00"));
    c1e2.taggable().addTagNamed("employee");

    Company c2 = Company.createCompany(editingContext, "XYZ Corp");
    c2.setLocation("Cupertino, CA");
    Employee c2e1 = Employee.createEmployee(editingContext, Boolean.TRUE, "Jane", new NSTimestamp(2008, 1, 15, 6, 30, 0, TimeZone.getDefault()), Boolean.TRUE, "Boss", EmployeeStatus.Available, c2);
    c2e1.taggable().addTagNamed("employee");
    c2e1.taggable().addTagNamed("boss");
    Employee c2e2 = Employee.createEmployee(editingContext, Boolean.FALSE, "Action", new NSTimestamp(2004, 11, 15, 6, 30, 0, TimeZone.getDefault()), Boolean.FALSE, "Jackson", EmployeeStatus.Available, c2);
    c2e2.taggable().addTagNamed("employee");
View Full Code Here


    return null;
  }

  public WOActionResults testCompany() {
    EOEditingContext editingContext = editingContext();
    Company company = company();
    Assert.assertEquals("Company name should have been " + _initialCompanyName + " before we save to the database.", _initialCompanyName , company.name());
    editingContext.saveChanges();

    Company reloadCompany = (Company) company.refetchObjectFromDBinEditingContext(editingContext());
    Assert.assertEquals("Company name should have been " + _initialCompanyName  + " after saving and refetching from the database.", _initialCompanyName, reloadCompany.name());

    String newName = "北方話 " + System.currentTimeMillis();
    reloadCompany.setName(newName);
    editingContext().saveChanges();

    Company updateCompany = (Company) _company.refetchObjectFromDBinEditingContext(editingContext());
    Assert.assertEquals("Company name should have been " + newName + " after updating and refetching from the database.", newName, updateCompany.name());

    Company fetchCompany = Company.fetchCompany(editingContext, Company.NAME_KEY, newName);
    Assert.assertNotNull("There should have been a Company named " + newName + " after updating and refetching from the database.", fetchCompany);
    Assert.assertEquals("There should have been a Company named " + newName + " after updating and refetching from the database.", newName, fetchCompany.name());
   
    updateCompany.delete();
    editingContext.saveChanges();

    _company = null;
View Full Code Here

    _companies.setSelectedObject(_company.localInstanceIn(_editingContext));
    return null;
  }

  public WOActionResults clearAttachment() {
    Company selectedCompany = selectedCompany();
    selectedCompany.setLogo(null);
    return null;
  }
View Full Code Here

TOP

Related Classes of er.uber.model.Company

Copyright © 2018 www.massapicom. 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.