KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > lazyonetoone > Employee


1 //$Id: Employee.java,v 1.2 2005/02/12 07:27:27 steveebersole Exp $
2
package org.hibernate.test.lazyonetoone;
3
4 import java.util.ArrayList JavaDoc;
5 import java.util.Collection JavaDoc;
6
7 /**
8  * @author Gavin King
9  */

10 public class Employee {
11     private String JavaDoc personName;
12     private Person person;
13     private Collection JavaDoc employments = new ArrayList JavaDoc();
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 JavaDoc getPersonName() {
27         return personName;
28     }
29     public void setPersonName(String JavaDoc personName) {
30         this.personName = personName;
31     }
32     public Collection JavaDoc getEmployments() {
33         return employments;
34     }
35     public void setEmployments(Collection JavaDoc employments) {
36         this.employments = employments;
37     }
38 }
39
Popular Tags