KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > entity > entitytest00 > Student


1 /**
2  * EasyBeans
3  * Copyright (C) 2006 Bull S.A.S.
4  * Contact: easybeans@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * 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 975 2006-07-28 11:14:14Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest00;
26
27 import javax.persistence.AttributeOverride;
28 import javax.persistence.AttributeOverrides;
29 import javax.persistence.Column;
30 import javax.persistence.DiscriminatorValue;
31 import javax.persistence.Entity;
32 import javax.persistence.Table;
33 import javax.persistence.UniqueConstraint;
34
35 /**
36  * The student.
37  * @author Gisele Pinheiro Souza
38  * @author Eduardo Studzinski Estima de Castro
39  *
40  */

41 @Entity
42 @DiscriminatorValue("Student")
43 @Table(name = "STUDENT", uniqueConstraints = @UniqueConstraint(columnNames = {"email"}))
44 @AttributeOverrides({
45       @AttributeOverride(name="startDate", column = @Column(name = "StudentStartDate")),
46       @AttributeOverride(name="endDate", column = @Column(name = "StudentEndDate"))
47 })
48 public class Student extends Person {
49
50     /**
51      *Serial version.
52      */

53     private static final long serialVersionUID = -7986846870958654109L;
54
55     /**
56      * Says if the student completed the studies in the university.
57      */

58     private boolean graduated;
59
60     /**
61      * The email.
62      */

63     private String JavaDoc email;
64
65
66     /**
67      * Returns the student email.
68      * @return the email.
69      */

70     public String JavaDoc getEmail() {
71         return email;
72     }
73
74     /**
75      * Sets the student e-mail.
76      * @param email the student e-mail.
77      */

78     public void setEmail(final String JavaDoc email) {
79         this.email = email;
80     }
81
82     /**
83      * Returns the student status in the college.
84      * @return true if the student finished the program,false otherwise.
85      */

86     public boolean isGraduated() {
87         return graduated;
88     }
89
90     /**
91      * Sets if the student is graduated.
92      * @param graduated true if the student has finished the course, false otherwise.
93      */

94     public void setGraduated(final boolean graduated) {
95         this.graduated = graduated;
96     }
97
98 }
99
Popular Tags