1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest03; 26 27 import java.util.Collection ; 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.OneToMany; 35 36 41 @Entity 42 @DiscriminatorValue("Professor") 43 public class Professor { 44 45 48 private static final long serialVersionUID = -6979637156066932597L; 49 50 53 private Degree degree; 54 55 58 private Long id; 59 60 63 private Collection <Class > classes; 64 65 69 @OneToMany(mappedBy = "professor") 70 public Collection <Class > getClasses() { 71 return classes; 72 } 73 74 78 public void setClasses(final Collection <Class > classes) { 79 this.classes = classes; 80 } 81 82 86 @Id 87 public Long getId() { 88 return id; 89 } 90 91 95 public void setId(final Long id) { 96 this.id = id; 97 } 98 99 103 @Enumerated(EnumType.STRING) 104 public Degree getDegree() { 105 return degree; 106 } 107 108 112 public void setDegree(final Degree degree) { 113 this.degree = degree; 114 } 115 116 } 117 | Popular Tags |