01: /**
02: * EasyBeans
03: * Copyright (C) 2006 Bull S.A.S.
04: * Contact: easybeans@ow2.org
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Lesser General Public
08: * License as published by the Free Software Foundation; either
09: * 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: RoomPK.java 1970 2007-10-16 11:49:25Z benoitf $
23: * --------------------------------------------------------------------------
24: */package org.ow2.easybeans.tests.common.ejbs.entity.entitytest01;
25:
26: import java.io.Serializable;
27:
28: import javax.persistence.Embeddable;
29: import javax.persistence.JoinColumn;
30: import javax.persistence.ManyToOne;
31:
32: /**
33: * The room primary key.
34: * @author Gisele Pinheiro Souza
35: * @author Eduardo Studzinski Estima de Castro
36: *
37: */
38: @Embeddable
39: public class RoomPK implements Serializable {
40:
41: /**
42: * Serial version.
43: */
44: private static final long serialVersionUID = -4342617189420663508L;
45:
46: /**
47: * The room identifier.
48: */
49: private Long roomID;
50:
51: /**
52: * The building.
53: */
54: private Building building;
55:
56: /**
57: * Returns the building that contains the room.
58: * @return the building.
59: */
60: public Building getBuilding() {
61: return building;
62: }
63:
64: /**
65: * Sets the room building.
66: * @param building the building.
67: */
68: @ManyToOne
69: @JoinColumn(name="id")
70: public void setBuilding(final Building building) {
71: this .building = building;
72: }
73:
74: /**
75: * Returns the romm identifier.
76: * @return the identifier.
77: */
78: public Long getRoomID() {
79: return roomID;
80: }
81:
82: /**
83: * Sets the identifier.
84: * @param roomID the identifier.
85: */
86: public void setRoomID(final Long roomID) {
87: this.roomID = roomID;
88: }
89:
90: }
|