KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.objectweb.jonas.jtests.beans.ejbql;
2
3 import java.util.Collection JavaDoc;
4
5 import javax.ejb.EntityContext JavaDoc;
6 import javax.ejb.CreateException JavaDoc;
7 import javax.ejb.FinderException JavaDoc;
8 import javax.ejb.RemoveException JavaDoc;
9
10 public abstract class ShipBean implements javax.ejb.EntityBean JavaDoc {
11     
12     public Integer JavaDoc ejbCreate(Integer JavaDoc primaryKey, String JavaDoc name, double tonnage) throws CreateException JavaDoc {
13     setId(primaryKey);
14     setName(name);
15     setTonnage(tonnage);
16     return null;
17     }
18     
19     public void ejbPostCreate(Integer JavaDoc primaryKey, String JavaDoc name, double tonnage) {
20     }
21
22     // persistent fields
23

24     public abstract void setId(Integer JavaDoc id);
25     public abstract Integer JavaDoc getId();
26     public abstract void setName(String JavaDoc name);
27     public abstract String JavaDoc getName( );
28     public abstract void setTonnage(double tonnage);
29     public abstract double getTonnage( );
30
31     // abstract ejbSelect() methods
32
public abstract double ejbSelectAverageOfTonnage() throws FinderException JavaDoc;
33     public abstract Collection JavaDoc ejbSelectListOfTonnage() throws FinderException JavaDoc;
34
35     // Public Home method required to test the private ejbSelectXXXX method
36
public double ejbHomeGetAverageOfTonnage() throws FinderException JavaDoc {
37         return this.ejbSelectAverageOfTonnage();
38     }
39
40     // standard call back methods
41
public void setEntityContext(EntityContext JavaDoc ec){}
42     public void unsetEntityContext(){}
43     public void ejbLoad(){}
44     public void ejbStore(){}
45     public void ejbActivate(){}
46     public void ejbPassivate(){}
47     public void ejbRemove() throws RemoveException JavaDoc {}
48
49 }
50
Popular Tags