01: package org.objectweb.jonas.jtests.beans.ejbql;
02:
03: import javax.ejb.EntityContext;
04: import javax.ejb.FinderException;
05: import org.objectweb.jonas.jtests.beans.ejbql.ShipLocal;
06:
07: public abstract class CabinBean implements javax.ejb.EntityBean {
08:
09: public Integer ejbCreate(Integer id)
10: throws javax.ejb.CreateException {
11: this .setId(id);
12: return null;
13: }
14:
15: public void ejbPostCreate(Integer id) {
16:
17: }
18:
19: public abstract void setId(Integer id);
20:
21: public abstract Integer getId();
22:
23: public abstract void setShip(ShipLocal ship);
24:
25: public abstract ShipLocal getShip();
26:
27: public abstract void setName(String name);
28:
29: public abstract String getName();
30:
31: public abstract void setBedCount(int count);
32:
33: public abstract int getBedCount();
34:
35: public abstract void setDeckLevel(int level);
36:
37: public abstract int getDeckLevel();
38:
39: // abstract ejbSelect() methods
40: public abstract int ejbSelectDeckLevel(Integer i)
41: throws FinderException;
42:
43: public int getShipId() {
44: return getShip().getId().intValue();
45: }
46:
47: public void setShipId(int sp) {
48: ShipLocal sl = getShip();
49: sl.setId(new Integer(sp));
50: setShip(sl);
51: }
52:
53: // Public Home method required to test the private ejbSelectXXXX method
54: public int ejbHomeSelectDeckLevel(Integer id)
55: throws FinderException {
56: return this .ejbSelectDeckLevel(id);
57: }
58:
59: public void setEntityContext(EntityContext ctx) {
60: // Not implemented.
61: }
62:
63: public void unsetEntityContext() {
64: // Not implemented.
65: }
66:
67: public void ejbActivate() {
68: // Not implemented.
69: }
70:
71: public void ejbPassivate() {
72: // Not implemented.
73: }
74:
75: public void ejbLoad() {
76: // Not implemented.
77: }
78:
79: public void ejbStore() {
80: // Not implemented.
81: }
82:
83: public void ejbRemove() throws javax.ejb.RemoveException {
84: // Not implemented.
85: }
86: }
|