use of org.eclipse.persistence.testing.models.employee.domain.EmploymentPeriod in project eclipselink by eclipse-ee4j.
the class DeepNestedUnitOfWorkTest method changeFirstLevelUnitOfWorkWorkingCopy.
protected void changeFirstLevelUnitOfWorkWorkingCopy() {
Employee employee = (Employee) this.unitOfWorkWorkingCopy[0];
// Transformation
employee.setNormalHours(new java.sql.Time[2]);
employee.setStartTime(Helper.timeFromHourMinuteSecond(1, 1, 1));
employee.setEndTime(Helper.timeFromHourMinuteSecond(1, 1, 1));
// Aggregate
employee.setPeriod(new EmploymentPeriod(Helper.dateFromYearMonthDate(1901, 1, 1), Helper.dateFromYearMonthDate(1902, 2, 2)));
}
use of org.eclipse.persistence.testing.models.employee.domain.EmploymentPeriod in project eclipselink by eclipse-ee4j.
the class NestedUnitOfWorkTest method changeUnitOfWorkWorkingCopy.
protected void changeUnitOfWorkWorkingCopy() {
Employee employee = (Employee) this.unitOfWorkWorkingCopy;
// Transformation
employee.setNormalHours(new java.sql.Time[2]);
employee.setStartTime(Helper.timeFromHourMinuteSecond(1, 1, 1));
employee.setEndTime(Helper.timeFromHourMinuteSecond(1, 1, 1));
// Aggregate
employee.setPeriod(new EmploymentPeriod(Helper.dateFromYearMonthDate(1901, 1, 1), Helper.dateFromYearMonthDate(1902, 2, 2)));
// One to many private
employee.setPhoneNumbers(new Vector());
employee.addPhoneNumber(new PhoneNumber("home", "613", "2263374"));
employee.addPhoneNumber(new PhoneNumber("office", "416", "8224599"));
// Many to many
employee.setProjects(new Vector());
employee.addProject((Project) this.unitOfWork.readObject(SmallProject.class));
employee.addProject((Project) this.unitOfWork.readObject(LargeProject.class));
// Direct collection
employee.setResponsibilitiesList(new Vector());
employee.addResponsibility("make coffee");
employee.addResponsibility("buy donuts");
// One to one private/public
employee.setAddress(new Address());
// make sure that the employee is not his own manager
employee.setManager((Employee) this.unitOfWork.readObject(Employee.class, (new ExpressionBuilder()).get("id").notEqual(employee.getId())));
}
use of org.eclipse.persistence.testing.models.employee.domain.EmploymentPeriod in project eclipselink by eclipse-ee4j.
the class NLSEmployeePopulator method employmentPeriodExample5.
public EmploymentPeriod employmentPeriodExample5() {
EmploymentPeriod employmentPeriod = new EmploymentPeriod();
employmentPeriod.setEndDate(Helper.dateFromYearMonthDate(1901, 11, 31));
employmentPeriod.setStartDate(Helper.dateFromYearMonthDate(19 - 5, 0, 1));
return employmentPeriod;
}
use of org.eclipse.persistence.testing.models.employee.domain.EmploymentPeriod in project eclipselink by eclipse-ee4j.
the class NLSEmployeePopulator method employmentPeriodExample10.
public EmploymentPeriod employmentPeriodExample10() {
EmploymentPeriod employmentPeriod = new EmploymentPeriod();
employmentPeriod.setStartDate(Helper.dateFromYearMonthDate(1991, 10, 11));
return employmentPeriod;
}
use of org.eclipse.persistence.testing.models.employee.domain.EmploymentPeriod in project eclipselink by eclipse-ee4j.
the class NLSEmployeePopulator method employmentPeriodExample1.
public EmploymentPeriod employmentPeriodExample1() {
EmploymentPeriod employmentPeriod = new EmploymentPeriod();
employmentPeriod.setEndDate(Helper.dateFromYearMonthDate(1996, 0, 1));
employmentPeriod.setStartDate(Helper.dateFromYearMonthDate(1993, 0, 1));
return employmentPeriod;
}
Aggregations