KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > easybeans > tests > common > ejbs > entity > entitytest04 > Professor


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: Professor.java 975 2006-07-28 11:14:14Z pinheirg $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest04;
26
27 import java.io.Serializable JavaDoc;
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 /**
38  * The Professor data.
39  * @author Gisele Pinheiro Souza
40  * @author Eduardo Studzinski Estima de Castro
41  */

42 @Entity
43 @DiscriminatorValue("Professor")
44 public class Professor implements Serializable JavaDoc {
45
46     /**
47      * Serial version.
48      */

49     private static final long serialVersionUID = -6979637156066932597L;
50
51     /**
52      * Professor id.
53      */

54     private Long JavaDoc id;
55
56     /**
57      * The professor degree.
58      */

59     private Degree degree;
60
61
62     /**
63      * The professor room.
64      */

65     private ProfessorRoom profRoom;
66
67     /**
68      * The address.
69      */

70     private Address address;
71
72     /**
73      * Gets the professor address.
74      * @return the address.
75      */

76     @OneToOne
77     public Address getAddress() {
78         return address;
79     }
80
81     /**
82      * Sets the professor address.
83      * @param address the professor address.
84      */

85     public void setAddress(final Address address) {
86         this.address = address;
87     }
88
89     /**
90      * Returns the professor room.
91      * @return the room.
92      */

93     @OneToOne
94     @JoinColumn
95     public ProfessorRoom getProfessorRoom() {
96         return profRoom;
97     }
98
99     /**
100      * Sets the professor room.
101      * @param profRoom the room.
102      */

103     public void setProfessorRoom(final ProfessorRoom profRoom) {
104         this.profRoom = profRoom;
105     }
106
107
108     /**
109      * Returns the professor degree.
110      * @return the degree.
111      */

112     @Enumerated(EnumType.STRING)
113     public Degree getDegree() {
114         return degree;
115     }
116
117     /**
118      * Sets the professor degree.
119      * @param degree the degree.
120      */

121     public void setDegree(final Degree degree) {
122         this.degree = degree;
123     }
124
125     /**
126      * Gets the professor identifier.
127      * @return the professor identifier.
128      */

129     @Id
130     public Long JavaDoc getId() {
131         return id;
132     }
133
134     /**
135      * Sets the professor identifier.
136      * @param id the identifier.
137      */

138     public void setId(final Long JavaDoc id) {
139         this.id = id;
140     }
141
142 }
143
Popular Tags