1 package org.hibernate.ejb.test.callbacks; 3 4 import java.math.BigDecimal ; 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 15 @Entity 16 @Table(name = "EMPLOYEE_TABLE") 17 @Inheritance(strategy = InheritanceType.JOINED) 18 public class Employee extends Person { 19 private String title; 20 private BigDecimal salary; 21 private Employee manager; 22 23 26 public String getTitle() { 27 return title; 28 } 29 30 33 public void setTitle(String title) { 34 this.title = title; 35 } 36 37 @OneToOne 38 @JoinColumn(name = "manager") 39 public Employee getManager() { 40 return manager; 41 } 42 43 46 public void setManager(Employee manager) { 47 this.manager = manager; 48 } 49 50 53 public BigDecimal getSalary() { 54 return salary; 55 } 56 57 60 public void setSalary(BigDecimal salary) { 61 this.salary = salary; 62 } 63 } 64 65 | Popular Tags |