hired.getTime(), 200000.0);
born.set(1960, 4, 8);
hired.set(1985, 2, 3);
Address addr3 = new Address (7003L, "1298 Wanderlust Road",
"Pleasanton", "CA", "95560", "USA");
Employee ed = new PartTimeEmployee(3002L, "Ed", "Zander", null,
born.getTime(), addr3,
hired.getTime(), 400000.0);
scott.addToTeam(ed);
// Set up their departments.
Department board =
new Department(2001L, "board", company);
h = new HashSet();
h.add(scott);
board.setEmployees(h);
scott.setDepartment(board);
company.addDepartment(board);
Department emg = new Department(2002L, "emg", company);
h = new HashSet();
h.add(ed);
emg.setEmployees(h);
ed.setDepartment(emg);
company.addDepartment(emg);
// Insure these guys
DentalInsurance scottDentalIns = new DentalInsurance(
5001L, "Aetna", scott, new BigDecimal("12000"));
MedicalInsurance scottMedicalIns = new MedicalInsurance(
5002L, "Aetna", scott, "PPO");
DentalInsurance edDentalIns = new DentalInsurance(
5003L, "BlueCross", ed, new BigDecimal("10000"));
MedicalInsurance edMedicalIns = new MedicalInsurance(
5004L, "BlueCross", ed, "EPO");
scott.setDentalInsurance(scottDentalIns);
scott.setMedicalInsurance(scottMedicalIns);
ed.setDentalInsurance(edDentalIns);
ed.setMedicalInsurance(edMedicalIns);
// Give them some projects to work on. Scott works on both; Ed only
// on one.
Project solaris = new Project(4001L, "Solaris", new BigDecimal(100.375));
Project sparc = new Project(4002L, "Sparc", new BigDecimal(200.500));
h = new HashSet();
h.add(scott);
h.add(ed);
solaris.setMembers(h); // Solaris is worked on by Scott and Ed
h = new HashSet();
h.add(scott);
sparc.setMembers(h); // Sparc is worked on by Scott
h = new HashSet();
h.add(solaris);
h.add(sparc);
scott.setProjects(h); // Scott works on Solaris and Sparc
h = new HashSet();
h.add(solaris);
ed.setProjects(h); // Ed works on Solaris
/* Now put all of these into the database
*/
pm.currentTransaction().begin();
pm.makePersistent (company);