1 25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest03; 26 27 import java.util.Collection ; 28 29 import javax.persistence.Entity; 30 import javax.persistence.Id; 31 import javax.persistence.JoinColumn; 32 import javax.persistence.JoinTable; 33 import javax.persistence.ManyToMany; 34 35 40 @Entity 41 public class Student { 42 43 46 private Long id; 47 48 51 private static final long serialVersionUID = -7986846870958654109L; 52 53 56 private boolean graduated; 57 58 61 private String email; 62 63 66 private Collection <Class > currentCours; 67 68 72 @ManyToMany 73 @JoinTable(name = "CLASS_STUDENT", joinColumns = {@JoinColumn(name = "STUDENT_ID", referencedColumnName = "id")}, 74 inverseJoinColumns = { 75 @JoinColumn(name = "CLASS_NAME", referencedColumnName = "className"), 76 @JoinColumn(name = "CLASS_YEAR", referencedColumnName = "classYear")}) 77 public Collection <Class > getCurrentCours() { 78 return currentCours; 79 } 80 81 85 public void setCurrentCours(final Collection <Class > currentCours) { 86 this.currentCours = currentCours; 87 } 88 89 93 public String getEmail() { 94 return email; 95 } 96 97 101 public void setEmail(final String email) { 102 this.email = email; 103 } 104 105 109 public boolean isGraduated() { 110 return graduated; 111 } 112 113 118 public void setGraduated(final boolean graduated) { 119 this.graduated = graduated; 120 } 121 122 126 @Id 127 public Long getId() { 128 return id; 129 } 130 131 135 public void setId(final Long id) { 136 this.id = id; 137 } 138 139 } 140 | Popular Tags |