1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest04; 26 27 import java.io.Serializable ; 28 29 import javax.persistence.DiscriminatorValue; 30 import javax.persistence.Entity; 31 import javax.persistence.EnumType; 32 import javax.persistence.Enumerated; 33 import javax.persistence.Id; 34 import javax.persistence.JoinColumn; 35 import javax.persistence.OneToOne; 36 37 42 @Entity 43 @DiscriminatorValue("Professor") 44 public class Professor implements Serializable { 45 46 49 private static final long serialVersionUID = -6979637156066932597L; 50 51 54 private Long id; 55 56 59 private Degree degree; 60 61 62 65 private ProfessorRoom profRoom; 66 67 70 private Address address; 71 72 76 @OneToOne 77 public Address getAddress() { 78 return address; 79 } 80 81 85 public void setAddress(final Address address) { 86 this.address = address; 87 } 88 89 93 @OneToOne 94 @JoinColumn 95 public ProfessorRoom getProfessorRoom() { 96 return profRoom; 97 } 98 99 103 public void setProfessorRoom(final ProfessorRoom profRoom) { 104 this.profRoom = profRoom; 105 } 106 107 108 112 @Enumerated(EnumType.STRING) 113 public Degree getDegree() { 114 return degree; 115 } 116 117 121 public void setDegree(final Degree degree) { 122 this.degree = degree; 123 } 124 125 129 @Id 130 public Long getId() { 131 return id; 132 } 133 134 138 public void setId(final Long id) { 139 this.id = id; 140 } 141 142 } 143 | Popular Tags |