01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * version 2.1 of the License, or any later version.
10: *
11: * This library is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * Lesser General Public License for more details.
15: *
16: * You should have received a copy of the GNU Lesser General Public
17: * License along with this library; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19: * USA
20: *
21: * --------------------------------------------------------------------------
22: * $Id: Student.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.tests.common.ejbs.entity.entitytest00;
25:
26: import javax.persistence.AttributeOverride;
27: import javax.persistence.AttributeOverrides;
28: import javax.persistence.Column;
29: import javax.persistence.DiscriminatorValue;
30: import javax.persistence.Entity;
31: import javax.persistence.Table;
32: import javax.persistence.UniqueConstraint;
33:
34: /**
35: * The student.
36: * @author Gisele Pinheiro Souza
37: * @author Eduardo Studzinski Estima de Castro
38: *
39: */
40: @Entity
41: @DiscriminatorValue("Student")
42: @Table(name="STUDENT",uniqueConstraints=@UniqueConstraint(columnNames={"email"}))
43: @AttributeOverrides({@AttributeOverride(name="startDate",column=@Column(name="StudentStartDate")),@AttributeOverride(name="endDate",column=@Column(name="StudentEndDate"))})
44: public class Student extends Person {
45:
46: /**
47: *Serial version.
48: */
49: private static final long serialVersionUID = -7986846870958654109L;
50:
51: /**
52: * Says if the student completed the studies in the university.
53: */
54: private boolean graduated;
55:
56: /**
57: * The email.
58: */
59: private String email;
60:
61: /**
62: * Returns the student email.
63: * @return the email.
64: */
65: public String getEmail() {
66: return email;
67: }
68:
69: /**
70: * Sets the student e-mail.
71: * @param email the student e-mail.
72: */
73: public void setEmail(final String email) {
74: this .email = email;
75: }
76:
77: /**
78: * Returns the student status in the college.
79: * @return true if the student finished the program,false otherwise.
80: */
81: public boolean isGraduated() {
82: return graduated;
83: }
84:
85: /**
86: * Sets if the student is graduated.
87: * @param graduated true if the student has finished the course, false otherwise.
88: */
89: public void setGraduated(final boolean graduated) {
90: this.graduated = graduated;
91: }
92:
93: }
|