1 22 package org.jboss.ejb3.test.joininheritance; 23 24 import javax.persistence.Entity; 25 import javax.persistence.Inheritance; 26 import javax.persistence.InheritanceType; 27 import javax.persistence.JoinColumn; 28 import javax.persistence.OneToOne; 29 import javax.persistence.Table; 30 import javax.persistence.NamedQuery; 31 32 35 @Entity 36 @Table(name="CUSTOMER_TABLE") 37 @Inheritance(strategy = InheritanceType.JOINED) 38 public class Customer extends Person 39 { 40 private Employee salesperson; 41 private String comments; 42 43 @OneToOne 44 @JoinColumn(name = "salesperson") 45 public Employee getSalesperson() 46 { 47 return salesperson; 48 } 49 50 public void setSalesperson(Employee salesperson) 51 { 52 this.salesperson = salesperson; 53 } 54 55 public String getComments() 56 { 57 return comments; 58 } 59 60 public void setComments(String comments) 61 { 62 this.comments = comments; 63 } 64 } 65 | Popular Tags |