KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > titan > ship > ShipBean


1 package com.titan.ship;
2
3 import javax.ejb.EntityContext;
4 import javax.ejb.CreateException;
5 import javax.ejb.RemoveException;
6
7 public abstract class ShipBean implements javax.ejb.EntityBean {
8     
9     public Integer ejbCreate(Integer primaryKey, String name, double tonnage) throws CreateException {
10         setId(primaryKey);
11         setName(name);
12         setTonnage(tonnage);
13         return null;
14     }
15     
16     public void ejbPostCreate(Integer primaryKey, String name, double tonnage) {
17     }
18
19     // persistent fields
20

21     public abstract void setId(Integer id);
22     public abstract Integer getId();
23     public abstract void setName(String name);
24     public abstract String getName( );
25     public abstract void setTonnage(double tonnage);
26     public abstract double getTonnage( );
27
28     // standard call back methods
29

30     public void setEntityContext(EntityContext ec){}
31     public void unsetEntityContext(){}
32     public void ejbLoad(){}
33     public void ejbStore(){}
34     public void ejbActivate(){}
35     public void ejbPassivate(){}
36     public void ejbRemove() throws RemoveException {}
37
38 }
39
Popular Tags