1 | public class Entity {↵ | | 1 | public class E↵
|
2 | ↵ | | 2 | mployee extends Person {↵
|
3 | private Long id;
↵ | | 3 | private String title;↵
|
4 | private String name;↵ | | 4 | private String ↵
|
5 | private Entity child;↵ | | |
|
6 | private Entity sibling;↵ | | |
|
7 |
↵ | | 5 | department;↵
|
| | | 6 | private Employee manager;↵
|
| | | 7 | private Set minions = new HashSet();↵
|
|
8 | public Entity() {
↵ | | 8 | public Employee() {↵
|
9 | }↵ | | 9 | }↵
|
10 |
↵ | | |
|
|
11 | public Entity(String name) {
↵ | | 10 | public Employee(String name) {↵
|
12 | this.name = name;↵ | | 11 | super( name↵
|
13 | }↵ | | |
|
14 |
↵ | | 12 | );↵
|
| | | 13 | }↵
|
|
15 | public Long getId() {
↵ | | 14 | public String getTitle() {↵
|
16 | return id;↵ | | 15 | return ↵
|
17 | }↵ | | |
|
18 |
↵ | | 16 | title;↵
|
| | | 17 | }↵
|
|
19 | public void setId(Long id) {
↵ | | 18 | public void setTitle(String title) {↵
|
20 | this.id = id;↵ | | 19 | this.↵
|
21 | }↵ | | |
|
22 |
↵ | | 20 | title = title;↵
|
| | | 21 | }↵
|
|
23 | public String getName() {
↵ | | 22 | public String getDepartment() {↵
|
24 | return name;↵ | | 23 | return ↵
|
25 | }↵ | | |
|
26 |
↵ | | 24 | department;↵
|
| | | 25 | }↵
|
|
27 | public void setName(String name) {
↵ | | 26 | public void setDepartment(String department) {↵
|
28 | this.name = name;↵ | | 27 | this.↵
|
29 | }↵ | | |
|
|
30 | public Entity getChild↵ | | 28 | department = department;↵
|
| | | 29 | }↵
|
|
31 | () {
↵ | | 30 | public Employee getManager() {↵
|
32 | return child;↵ | | 31 | return ↵
|
33 | }↵ | | |
|
34 |
↵ | | 32 | manager;↵
|
| | | 33 | }↵
|
|
35 | public void setChild(Entity child) {
↵ | | 34 | public void setManager(Employee manager) {↵
|
36 | this.child = child;↵ | | 35 | this.↵
|
37 | }↵ | | |
|
38 |
↵ | | 36 | manager = manager;↵
|
| | | 37 | }↵
|
|
39 | public Entity getSibling() {
↵ | | 38 | public Set getMinions() {↵
|
40 | return sibling;↵ | | 39 | return ↵
|
41 | }↵ | | |
|
42 |
↵ | | 40 | minions;↵
|
| | | 41 | }↵
|
|
43 | public void setSibling(Entity sibling) {
↵ | | 42 | public void setMinions(Set minions) {↵
|
44 | this.sibling = sibling;
↵ | | 43 | this.minions = minions;↵
|
45 | | | 44 |
|