1 package org.hibernate.test.lazyonetoone; 3 4 import java.util.ArrayList ; 5 import java.util.Collection ; 6 7 10 public class Employee { 11 private String personName; 12 private Person person; 13 private Collection employments = new ArrayList (); 14 Employee() {} 15 public Employee(Person p) { 16 this.person = p; 17 this.personName = p.getName(); 18 p.setEmployee(this); 19 } 20 public Person getPerson() { 21 return person; 22 } 23 public void setPerson(Person person) { 24 this.person = person; 25 } 26 public String getPersonName() { 27 return personName; 28 } 29 public void setPersonName(String personName) { 30 this.personName = personName; 31 } 32 public Collection getEmployments() { 33 return employments; 34 } 35 public void setEmployments(Collection employments) { 36 this.employments = employments; 37 } 38 } 39 | Popular Tags |