1 package org.hibernate.ejb.test.callbacks; 3 4 import javax.persistence.Entity; 5 import javax.persistence.Inheritance; 6 import javax.persistence.InheritanceType; 7 import javax.persistence.JoinColumn; 8 import javax.persistence.OneToOne; 9 import javax.persistence.Table; 10 11 14 @Entity 15 @Table(name = "CUSTOMER_TABLE") 16 @Inheritance(strategy = InheritanceType.JOINED) 17 public class Customer extends Person { 18 private Employee salesperson; 19 private String comments; 20 21 @OneToOne 22 @JoinColumn(name = "salesperson") 23 public Employee getSalesperson() { 24 return salesperson; 25 } 26 27 public void setSalesperson(Employee salesperson) { 28 this.salesperson = salesperson; 29 } 30 31 public String getComments() { 32 return comments; 33 } 34 35 public void setComments(String comments) { 36 this.comments = comments; 37 } 38 } 39 | Popular Tags |