KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jonas > jtests > beans > ejbql > CabinBean


1 package org.objectweb.jonas.jtests.beans.ejbql;
2
3 import javax.ejb.EntityContext JavaDoc;
4 import javax.ejb.FinderException JavaDoc;
5 import org.objectweb.jonas.jtests.beans.ejbql.ShipLocal;
6
7 public abstract class CabinBean implements javax.ejb.EntityBean JavaDoc {
8
9     public Integer JavaDoc ejbCreate(Integer JavaDoc id) throws javax.ejb.CreateException JavaDoc {
10     this.setId(id);
11     return null;
12     }
13     public void ejbPostCreate(Integer JavaDoc id){
14         
15     }
16     public abstract void setId(Integer JavaDoc id);
17     public abstract Integer JavaDoc getId();
18  
19     public abstract void setShip(ShipLocal ship);
20     public abstract ShipLocal getShip( );
21
22     public abstract void setName(String JavaDoc name);
23     public abstract String JavaDoc getName( );
24
25     public abstract void setBedCount(int count);
26     public abstract int getBedCount( );
27
28     public abstract void setDeckLevel(int level);
29     public abstract int getDeckLevel( );
30
31     // abstract ejbSelect() methods
32
public abstract int ejbSelectDeckLevel(Integer JavaDoc i) throws FinderException JavaDoc;
33
34
35     public int getShipId() {
36     return getShip().getId().intValue();
37     }
38
39     public void setShipId(int sp) {
40     ShipLocal sl = getShip( );
41     sl.setId(new Integer JavaDoc(sp));
42     setShip(sl);
43     }
44
45     // Public Home method required to test the private ejbSelectXXXX method
46
public int ejbHomeSelectDeckLevel(Integer JavaDoc id) throws FinderException JavaDoc {
47         return this.ejbSelectDeckLevel(id);
48     }
49
50     public void setEntityContext(EntityContext JavaDoc ctx) {
51          // Not implemented.
52
}
53     public void unsetEntityContext() {
54          // Not implemented.
55
}
56     public void ejbActivate() {
57         // Not implemented.
58
}
59     public void ejbPassivate() {
60         // Not implemented.
61
}
62     public void ejbLoad() {
63         // Not implemented.
64
}
65     public void ejbStore() {
66         // Not implemented.
67
}
68     public void ejbRemove() throws javax.ejb.RemoveException JavaDoc {
69         // Not implemented.
70
}
71 }
72
Popular Tags