1 22 package org.jboss.ejb3.test.tableperinheritance; 23 24 import javax.persistence.Entity; 25 import javax.persistence.JoinColumn; 26 import javax.persistence.OneToOne; 27 import java.math.BigDecimal ; 28 29 32 @Entity 33 public class Employee extends Person 35 { 36 private String title; 37 private BigDecimal salary; 38 private Employee manager; 39 40 43 public String getTitle() 44 { 45 return title; 46 } 47 48 51 public void setTitle(String title) 52 { 53 this.title = title; 54 } 55 56 @OneToOne 57 @JoinColumn(name = "manager") 58 public Employee getManager() 59 { 60 return manager; 61 } 62 63 66 public void setManager(Employee manager) 67 { 68 this.manager = manager; 69 } 70 71 74 public BigDecimal getSalary() 75 { 76 return salary; 77 } 78 79 82 public void setSalary(BigDecimal salary) 83 { 84 this.salary = salary; 85 } 86 } 87 | Popular Tags |