01: /**
02: * Copyright (C) 2001-2005 France Telecom R&D
03: *
04: * This library is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License as published by the Free Software Foundation; either
07: * version 2 of the License, or (at your option) any later version.
08: *
09: * This library is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12: * Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public
15: * License along with this library; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: */package org.objectweb.speedo.ejb.pobjects.basic;
18:
19: import junit.framework.Assert;
20:
21: import java.io.Serializable;
22:
23: import javax.persistence.Basic;
24: import javax.persistence.EmbeddedId;
25: import javax.persistence.Entity;
26: import javax.persistence.Table;
27:
28: /**
29: * This class defines an embedded composite PK identifier.
30: * @author P. Dechamboux
31: */
32: @Entity
33: @Table(name="EJB_EMBEDPKID")
34: public class EmbedPkId implements Serializable {
35: @EmbeddedId
36: private AccCompPk id;
37: @Basic
38: private int int_field;
39:
40: public void assign(long longval) {
41: this .int_field = (int) longval;
42: }
43:
44: public void check(long longval) {
45: Assert.assertEquals("bad int_field value", int_field,
46: (int) longval);
47: }
48:
49: public int retrieve_int_field() {
50: return int_field;
51: }
52:
53: public void assign_int_field(int int_field) {
54: this.int_field = int_field;
55: }
56: }
|