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.Entity;
25: import javax.persistence.Id;
26: import javax.persistence.IdClass;
27: import javax.persistence.Lob;
28: import javax.persistence.Table;
29:
30: /**
31: * This class defines an embedded composite PK identifier.
32: * @author P. Dechamboux
33: */
34: @Entity
35: @Table(name="EJB_BASICLOB")
36: public class BasicLob implements Serializable {
37: @Id
38: private Long id;
39: @Lob
40: private byte[] lobval;
41: @Basic(optional=false)
42: private Integer int_field;
43:
44: public void assign(long longval) {
45: this .int_field = new Integer((int) longval);
46: }
47:
48: public void check(long longval) {
49: Assert.assertEquals("bad int_field value", int_field,
50: new Integer((int) longval));
51: }
52:
53: public int retrieve_int_field() {
54: return int_field.intValue();
55: }
56:
57: public void assign_int_field(int int_field) {
58: this .int_field = new Integer(int_field);
59: }
60: }
|