1 package org.hibernate.test.lazyonetoone; 3 4 import java.io.Serializable ; 5 import java.util.Date ; 6 7 10 public class Employment implements Serializable { 11 private String personName; 12 private String organizationName; 13 private Date startDate; 14 private Date endDate; 15 Employment() {} 16 public Employment(Employee e, String org) { 17 this.personName = e.getPersonName(); 18 this.organizationName = org; 19 startDate = new Date (); 20 e.getEmployments().add(this); 21 } 22 public String getOrganizationName() { 23 return organizationName; 24 } 25 public void setOrganizationName(String organizationName) { 26 this.organizationName = organizationName; 27 } 28 public String getPersonName() { 29 return personName; 30 } 31 public void setPersonName(String personName) { 32 this.personName = personName; 33 } 34 public Date getEndDate() { 35 return endDate; 36 } 37 public void setEndDate(Date endDate) { 38 this.endDate = endDate; 39 } 40 public Date getStartDate() { 41 return startDate; 42 } 43 public void setStartDate(Date startDate) { 44 this.startDate = startDate; 45 } 46 } 47 | Popular Tags |