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: Professor.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.DiscriminatorValue;
029: import javax.persistence.Entity;
030: import javax.persistence.EnumType;
031: import javax.persistence.Enumerated;
032: import javax.persistence.Id;
033: import javax.persistence.JoinColumn;
034: import javax.persistence.OneToOne;
035:
036: /**
037: * The Professor data.
038: * @author Gisele Pinheiro Souza
039: * @author Eduardo Studzinski Estima de Castro
040: */
041: @Entity
042: @DiscriminatorValue("Professor")
043: public class Professor implements Serializable {
044:
045: /**
046: * Serial version.
047: */
048: private static final long serialVersionUID = -6979637156066932597L;
049:
050: /**
051: * Professor id.
052: */
053: private Long id;
054:
055: /**
056: * The professor degree.
057: */
058: private Degree degree;
059:
060: /**
061: * The professor room.
062: */
063: private ProfessorRoom profRoom;
064:
065: /**
066: * The address.
067: */
068: private Address address;
069:
070: /**
071: * Gets the professor address.
072: * @return the address.
073: */
074: @OneToOne
075: public Address getAddress() {
076: return address;
077: }
078:
079: /**
080: * Sets the professor address.
081: * @param address the professor address.
082: */
083: public void setAddress(final Address address) {
084: this .address = address;
085: }
086:
087: /**
088: * Returns the professor room.
089: * @return the room.
090: */
091: @OneToOne
092: @JoinColumn
093: public ProfessorRoom getProfessorRoom() {
094: return profRoom;
095: }
096:
097: /**
098: * Sets the professor room.
099: * @param profRoom the room.
100: */
101: public void setProfessorRoom(final ProfessorRoom profRoom) {
102: this .profRoom = profRoom;
103: }
104:
105: /**
106: * Returns the professor degree.
107: * @return the degree.
108: */
109: @Enumerated(EnumType.STRING)
110: public Degree getDegree() {
111: return degree;
112: }
113:
114: /**
115: * Sets the professor degree.
116: * @param degree the degree.
117: */
118: public void setDegree(final Degree degree) {
119: this .degree = degree;
120: }
121:
122: /**
123: * Gets the professor identifier.
124: * @return the professor identifier.
125: */
126: @Id
127: public Long getId() {
128: return id;
129: }
130:
131: /**
132: * Sets the professor identifier.
133: * @param id the identifier.
134: */
135: public void setId(final Long id) {
136: this.id = id;
137: }
138:
139: }
|