1 package ejava.examples.orm.inheritance.annotated;
2
3 import java.util.Date;
4
5 import javax.persistence.*;
6
7
8
9
10
11
12
13 @Entity
14 @Table(name="ORMINH_EMPLOYEE")
15 public class Employee extends Person {
16 private double payrate;
17 @Temporal(TemporalType.DATE)
18 private Date hireDate;
19
20 public Employee() {}
21 public Employee(long id) { super(id); }
22
23 public Date getHireDate() { return hireDate; }
24 public void setHireDate(Date hireDate) {
25 this.hireDate = hireDate;
26 }
27
28 public double getPayrate() { return payrate; }
29 public void setPayrate(double payrate) {
30 this.payrate = payrate;
31 }
32
33 public String toString() {
34 StringBuilder text = new StringBuilder(super.toString());
35 text.append(", payrate=" + payrate);
36 return text.toString();
37 }
38 }