1 | public class Parent {↵ | | 1 | public class Employee extends Person {↵
|
2 | private Long id;↵ | | 2 | private ↵
|
3 | private String name;↵ | | |
|
4 | private Collection children = new HashSet()↵ | | 3 | String title;↵
|
| | | 4 | private BigDecimal salary;↵
|
5 | ;↵ | | 5 | private Employee manager;↵
|
6 | /**↵ | | 6 | /**↵
|
7 | * @return Returns the children.↵ | | 7 | * @return Returns the title.↵
|
8 | */↵ | | 8 | */↵
|
9 | public Collection getChildren() {↵ | | 9 | public String getTitle() {↵
|
10 | return children;↵ | | 10 | return title;↵
|
11 | }↵ | | 11 | }↵
|
12 | /**↵ | | 12 | /**↵
|
13 | * @param children The children to set.↵ | | 13 | * @param title The title to set.↵
|
14 | */↵ | | 14 | */↵
|
15 | public void setChildren(Collection children) {↵ | | 15 | public void setTitle(String title) {↵
|
16 | this.children = children;↵ | | 16 | this.title = title;↵
|
17 | }↵ | | 17 | }↵
|
18 | /**↵ | | 18 | /**↵
|
19 | * @return Returns the id.↵ | | 19 | * @return Returns the manager.↵
|
20 | */↵ | | 20 | */↵
|
21 | public Long getId() {↵ | | 21 | public Employee getManager() {↵
|
22 | return id;↵ | | 22 | return manager;↵
|
23 | }↵ | | 23 | }↵
|
24 | /**↵ | | 24 | /**↵
|
25 | * @param id The id to set.↵ | | 25 | * @param manager The manager to set.↵
|
26 | */↵ | | 26 | */↵
|
27 | public void setId(Long id) {↵ | | 27 | public void set↵
|
28 | this.id = id↵ | | 28 | Manager(Employee manager) {↵
|
29 | ;↵ | | 29 | this.manager = manager;↵
|
30 | }↵ | | 30 | }↵
|
31 | /**↵ | | 31 | /**↵
|
32 | * @return Returns the name.↵ | | 32 | * @return Returns the salary.↵
|
33 | */↵ | | 33 | */↵
|
34 | public String getName() {↵ | | 34 | public BigDecimal getSalary() {↵
|
35 | return name;↵ | | 35 | return salary;↵
|
36 | }↵ | | 36 | }↵
|
37 | /**↵ | | 37 | /**↵
|
38 | * @param name The name to set.↵ | | 38 | * @param salary The salary to set.↵
|
39 | */↵ | | 39 | */↵
|
40 | public void setName(String name) {↵ | | 40 | public void set↵
|
41 | this.name = name↵ | | 41 | Salary(BigDecimal salary) {↵
|
42 | ;↵ | | 42 | this.salary = salary;↵
|
43 | | | 43 |
|