1 | public class PersonalDetails {
↵ | | 1 | public class Person {↵
|
2 | private Long id;↵ | | 2 | private ↵
|
3 | private String somePersonalDetail;↵ | | |
|
4 | private Person person;↵ | | |
|
|
5 | public PersonalDetails() {↵ | | |
|
6 | }↵ | | |
|
|
7 | public PersonalDetails(String somePersonalDetail, Person person↵ | | 3 | String name;↵
|
| | | 4 | private Date dob;↵
|
| | | 5 | private String currentAddress;↵
|
| | | 6 | Person() {}↵
|
8 | ) {
↵ | | 7 | public Person(String name, Date dob, String address) {↵
|
9 | this.somePersonalDetail = somePersonalDetail;↵ | | 8 | this.↵
|
10 | this.person = person;↵ | | |
|
11 | person.setDetails( this );↵ | | |
|
12 | }↵ | | |
|
13 |
↵ | | 9 | name = name;↵
|
| | | 10 | this.dob = dob;↵
|
| | | 11 | this.currentAddress = address;↵
|
| | | 12 | }↵
|
14 | public Long getId() {
↵ | | 13 | public Date getDob() {↵
|
15 | return id;↵ | | 14 | return ↵
|
16 | }↵ | | |
|
17 |
↵ | | 15 | dob;↵
|
| | | 16 | }↵
|
18 | public void setId(Long id) {
↵ | | 17 | public void setDob(Date dob) {↵
|
19 | this.id = id;↵ | | 18 | this.↵
|
20 | }↵ | | |
|
21 |
↵ | | 19 | dob = dob;↵
|
| | | 20 | }↵
|
22 | public String getSomePersonalDetail() {
↵ | | 21 | public String getName() {↵
|
23 | return somePersonalDetail;↵ | | 22 | return ↵
|
24 | }↵ | | |
|
|
25 | public void setSomePersonalDetail(String somePersonalDetail↵ | | 23 | name;↵
|
| | | 24 | }↵
|
26 | ) {
↵ | | 25 | public void setName(String name) {↵
|
27 | this.somePersonalDetail = somePersonalDetail;↵ | | 26 | this.↵
|
28 | }↵ | | |
|
|
29 | public Person getPerson↵ | | 27 | name = name;↵
|
| | | 28 | }↵
|
30 | () {
↵ | | 29 | public String getCurrentAddress() {↵
|
31 | return person;↵ | | 30 | return ↵
|
32 | }↵ | | |
|
|
33 | public void setPerson(Person person↵ | | 31 | currentAddress;↵
|
| | | 32 | }↵
|
34 | ) {
↵ | | 33 | public void setCurrentAddress(String currentAddress) {↵
|
35 | this.person = person;
↵ | | 34 | this.currentAddress = currentAddress;↵
|
36 | | | 35 |
|