KickJava   Java API By Example, From Geeks To Geeks.

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


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: ProfessorRoom.java 1162 2006-10-18 11:13:18Z benoitf $
23  * --------------------------------------------------------------------------
24  */

25 package org.objectweb.easybeans.tests.common.ejbs.entity.entitytest04;
26
27 import java.io.Serializable JavaDoc;
28
29 import javax.persistence.Basic;
30 import javax.persistence.Entity;
31 import javax.persistence.FetchType;
32 import javax.persistence.Id;
33 import javax.persistence.OneToOne;
34
35 /**
36  * The professor room.
37  * @author Gisele Pinheiro Souza
38  * @author Eduardo Studzinski Estima de Castro
39  */

40 @Entity
41 public class ProfessorRoom implements Serializable JavaDoc {
42
43     /**
44      * The serial version.
45      */

46     private static final long serialVersionUID = 4584689820008347097L;
47
48     /**
49      * The room name.
50      */

51     private String JavaDoc name;
52
53     /**
54      * Room identifier.
55      */

56     private Long JavaDoc id;
57
58     /**
59      * Owner.
60      */

61     private Professor professor;
62
63     /**
64      * The professor that is using the room.
65      * @return the professor.
66      */

67     @OneToOne(mappedBy = "professorRoom")
68     public Professor getProfessor() {
69         return professor;
70     }
71
72     /**
73      * Sets the professor that is using the room.
74      * @param professor the professor.
75      */

76     public void setProfessor(final Professor professor) {
77         this.professor = professor;
78     }
79
80     /**
81      * Gets the room identifier.
82      * @return the identifier.
83      */

84     @Id
85     public Long JavaDoc getId() {
86         return id;
87     }
88
89     /**
90      * Sets the room identifier.
91      * @param id the identifier.
92      */

93     public void setId(final Long JavaDoc id) {
94         this.id = id;
95     }
96
97     /**
98      * Returns the room name.
99      * @return the name.
100      */

101     @Basic(fetch = FetchType.LAZY)
102     public String JavaDoc getName() {
103         return name;
104     }
105
106     /**
107      * Sets the room name.
108      * @param name the name.
109      */

110     public void setName(final String JavaDoc name) {
111         this.name = name;
112     }
113
114 }
115
Popular Tags