001: /**
002: * EasyBeans
003: * Copyright (C) 2006 Bull S.A.S.
004: * Contact: easybeans@ow2.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: ProfessorRoom.java 1970 2007-10-16 11:49:25Z benoitf $
023: * --------------------------------------------------------------------------
024: */package org.ow2.easybeans.tests.common.ejbs.entity.entitytest04;
025:
026: import java.io.Serializable;
027:
028: import javax.persistence.Basic;
029: import javax.persistence.Entity;
030: import javax.persistence.FetchType;
031: import javax.persistence.Id;
032: import javax.persistence.OneToOne;
033:
034: /**
035: * The professor room.
036: * @author Gisele Pinheiro Souza
037: * @author Eduardo Studzinski Estima de Castro
038: */
039: @Entity
040: public class ProfessorRoom implements Serializable {
041:
042: /**
043: * The serial version.
044: */
045: private static final long serialVersionUID = 4584689820008347097L;
046:
047: /**
048: * The room name.
049: */
050: private String name;
051:
052: /**
053: * Room identifier.
054: */
055: private Long id;
056:
057: /**
058: * Owner.
059: */
060: private Professor professor;
061:
062: /**
063: * The professor that is using the room.
064: * @return the professor.
065: */
066: @OneToOne(mappedBy="professorRoom")
067: public Professor getProfessor() {
068: return professor;
069: }
070:
071: /**
072: * Sets the professor that is using the room.
073: * @param professor the professor.
074: */
075: public void setProfessor(final Professor professor) {
076: this .professor = professor;
077: }
078:
079: /**
080: * Gets the room identifier.
081: * @return the identifier.
082: */
083: @Id
084: public Long getId() {
085: return id;
086: }
087:
088: /**
089: * Sets the room identifier.
090: * @param id the identifier.
091: */
092: public void setId(final Long id) {
093: this .id = id;
094: }
095:
096: /**
097: * Returns the room name.
098: * @return the name.
099: */
100: @Basic(fetch=FetchType.LAZY)
101: public String getName() {
102: return name;
103: }
104:
105: /**
106: * Sets the room name.
107: * @param name the name.
108: */
109: public void setName(final String name) {
110: this.name = name;
111: }
112:
113: }
|