コード例 #1
0
 protected void changeNestedUnitOfWorkAgain2() {
   // Many to many
   nestedUnitOfWorkWorkingCopy.setProjects(new Vector());
   // Direct collection
   nestedUnitOfWorkWorkingCopy.addResponsibility("dragon boat this summer");
   // One to one private/public
   nestedUnitOfWorkWorkingCopy.setAddress(
       new org.eclipse.persistence.testing.models.employee.domain.Address());
   nestedUnitOfWorkWorkingCopy.setManager(null);
 }
コード例 #2
0
 protected void changeNestedUnitOfWork() {
   // Many to many
   nestedUnitOfWorkWorkingCopy.setProjects(new Vector());
   nestedUnitOfWorkWorkingCopy.addProject(
       (org.eclipse.persistence.testing.models.employee.domain.Project)
           this.nestedUnitOfWork.readObject(SmallProject.class));
   nestedUnitOfWorkWorkingCopy.addProject(
       (org.eclipse.persistence.testing.models.employee.domain.Project)
           this.nestedUnitOfWork.readObject(LargeProject.class));
   // Direct collection
   nestedUnitOfWorkWorkingCopy.setResponsibilitiesList(new Vector());
   nestedUnitOfWorkWorkingCopy.addResponsibility("does not make cafee");
   nestedUnitOfWorkWorkingCopy.addResponsibility("does not buy donuts");
   // One to one private/public
   nestedUnitOfWorkWorkingCopy.setAddress(
       new org.eclipse.persistence.testing.models.employee.domain.Address());
   nestedUnitOfWorkWorkingCopy.setManager(
       (Employee) this.nestedUnitOfWork.readObject(Employee.class));
 }
コード例 #3
0
 protected void changeObject() {
   Employee employee = (Employee) this.workingCopy;
   // Direct to field
   employee.setFirstName(new String(employee.getFirstName().getBytes()));
   // Object type
   employee.setGender(new String(employee.getGender().getBytes()));
   // Transformation
   employee.setNormalHours(employee.getNormalHours().clone());
   // Aggregate
   employee.setPeriod(
       new EmploymentPeriod(
           employee.getPeriod().getStartDate(), employee.getPeriod().getEndDate()));
   // One to many private/public
   employee.setPhoneNumbers((Vector) employee.getPhoneNumbers().clone());
   employee.setProjects((Vector) employee.getProjects().clone());
   employee.setManagedEmployees((Vector) employee.getManagedEmployees().clone());
   // Direct collection
   employee.setResponsibilitiesList((Vector) employee.getResponsibilitiesList().clone());
   // One to one private/public
   employee.getAddress();
   employee.getManager();
 }