01: package org.objectweb.jonas.jtests.beans.ejbql;
02:
03: import java.util.Collection;
04:
05: import javax.ejb.EntityContext;
06: import javax.ejb.CreateException;
07: import javax.ejb.FinderException;
08: import javax.ejb.RemoveException;
09:
10: public abstract class ShipBean implements javax.ejb.EntityBean {
11:
12: public Integer ejbCreate(Integer primaryKey, String name,
13: double tonnage) throws CreateException {
14: setId(primaryKey);
15: setName(name);
16: setTonnage(tonnage);
17: return null;
18: }
19:
20: public void ejbPostCreate(Integer primaryKey, String name,
21: double tonnage) {
22: }
23:
24: // persistent fields
25:
26: public abstract void setId(Integer id);
27:
28: public abstract Integer getId();
29:
30: public abstract void setName(String name);
31:
32: public abstract String getName();
33:
34: public abstract void setTonnage(double tonnage);
35:
36: public abstract double getTonnage();
37:
38: // abstract ejbSelect() methods
39: public abstract double ejbSelectAverageOfTonnage()
40: throws FinderException;
41:
42: public abstract Collection ejbSelectListOfTonnage()
43: throws FinderException;
44:
45: // Public Home method required to test the private ejbSelectXXXX method
46: public double ejbHomeGetAverageOfTonnage() throws FinderException {
47: return this .ejbSelectAverageOfTonnage();
48: }
49:
50: // standard call back methods
51: public void setEntityContext(EntityContext ec) {
52: }
53:
54: public void unsetEntityContext() {
55: }
56:
57: public void ejbLoad() {
58: }
59:
60: public void ejbStore() {
61: }
62:
63: public void ejbActivate() {
64: }
65:
66: public void ejbPassivate() {
67: }
68:
69: public void ejbRemove() throws RemoveException {
70: }
71:
72: }
|