01: package com.triactive.jdo.test;
02:
03: import java.util.Collection;
04: import java.util.HashSet;
05: import java.util.Set;
06:
07: public class Manager extends Employee {
08: public Set subordinates;
09: public Set departments;
10:
11: // String department;
12:
13: /**
14: * Default constructor required since this is a PersistenceCapable class.
15: */
16: protected Manager() {
17: }
18:
19: public Manager(long id, String firstname, String lastname,
20: String email, float salary, String serial) {
21: super (id, firstname, lastname, email, salary, serial);
22: // this.department = dept;
23: this .departments = new HashSet();
24: this .subordinates = new HashSet();
25: }
26:
27: public Set getSubordinates() {
28: return this .subordinates;
29: }
30:
31: public void addSubordinate(Employee e) {
32: this .subordinates.add(e);
33: }
34:
35: public void addSubordinates(Collection c) {
36: this .subordinates.addAll(c);
37: }
38:
39: public Set getDepartments() {
40: return this .departments;
41: }
42:
43: public void addDepartment(Department d) {
44: this .departments.add(d);
45: }
46:
47: public void removeDepartment(Department d) {
48: this.departments.remove(d);
49: }
50:
51: }
|