package ejb.demo2; /** * DemoBean -- This is implemented by the EnterPrise`Bean. * This class must extend`javax.ejb.EntityBean and implement * the methods in this interface as well as providing * the implementation of the business methods. * */ import javax.ejb.*; import javax.naming.*; import java.rmi.*; public class Demo2Bean implements javax.ejb.EntityBean { transient private EntityContext ctx; //Instance member variables. // public String ID; public int value; public String ejbCreate(String PK) throws javax.ejb.CreateException, java.rmi.RemoteException { this.ID = PK; return null; } public void ejbPostCreate(String PK) throws javax.ejb.CreateException, java.rmi.RemoteException { } public String getID() throws java.rmi.RemoteException { return ID; } public void setID(String ID) throws java.rmi.RemoteException { this.ID = ID; } public int getvalue() throws java.rmi.RemoteException { return value; } public void setvalue(int value) throws java.rmi.RemoteException { this.value = value; } public void setEntityContext(EntityContext ctx) { this.ctx = ctx; } public void unsetEntityContext() { ctx = null; } public void ejbActivate() { } public void ejbPassivate() { } public void ejbLoad() { } public void ejbStore() { } public void ejbRemove() { } public String ejbFindByPrimaryKey(String PK) throws javax.ejb.CreateException, java.rmi.RemoteException, javax.ejb.FinderException { return this.ID; } }