KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > ejb > test > callbacks > Employee


1 //$Id: Employee.java,v 1.1 2005/07/21 00:08:34 epbernard Exp $
2
package org.hibernate.ejb.test.callbacks;
3
4 import java.math.BigDecimal JavaDoc;
5 import javax.persistence.Entity;
6 import javax.persistence.Inheritance;
7 import javax.persistence.InheritanceType;
8 import javax.persistence.JoinColumn;
9 import javax.persistence.OneToOne;
10 import javax.persistence.Table;
11
12 /**
13  * @author Emmanuel Bernard
14  */

15 @Entity
16         @Table(name = "EMPLOYEE_TABLE")
17         @Inheritance(strategy = InheritanceType.JOINED)
18         public class Employee extends Person {
19     private String JavaDoc title;
20     private BigDecimal JavaDoc salary;
21     private Employee manager;
22
23     /**
24      * @return Returns the title.
25      */

26     public String JavaDoc getTitle() {
27         return title;
28     }
29
30     /**
31      * @param title The title to set.
32      */

33     public void setTitle(String JavaDoc title) {
34         this.title = title;
35     }
36
37     @OneToOne
38             @JoinColumn(name = "manager")
39             public Employee getManager() {
40         return manager;
41     }
42
43     /**
44      * @param manager The manager to set.
45      */

46     public void setManager(Employee manager) {
47         this.manager = manager;
48     }
49
50     /**
51      * @return Returns the salary.
52      */

53     public BigDecimal JavaDoc getSalary() {
54         return salary;
55     }
56
57     /**
58      * @param salary The salary to set.
59      */

60     public void setSalary(BigDecimal JavaDoc salary) {
61         this.salary = salary;
62     }
63 }
64
65
Popular Tags