Thanks for reply. I have compared my EmployeeBean.java with the Oriely Workbook Titan example and looked okay.
Well, here is the EmployeeBean.java for your perusal:
-----------------------------------------------------
package com.nri.po.ejb;
import javax.ejb.EntityBean;
import javax.ejb.EntityContext;
import javax.ejb.CreateException;
/**
* CMP bean for Employee record
*/
public abstract class EmployeeBean implements EntityBean {
/*
* Unlike in 1.0 and 1.1, there is no need to define the context or CMP fields as attributes in 2.x
*
* However, we need to define the Accessor/Mutator methods for CMP fields -
* a) These methods must be abstract, as the implementation will be provided by Container provider
* b) Unlike the local interface, here we MUST have the setter methods also for the read-only fields.
*/
public abstract
String getFirstname();
public abstract void setFirstname(String s);
public abstract String getLastname();
public abstract void setLastname(String s);
public abstract String getIdentifier();
public abstract void setIdentifier(String s);
public abstract String getPassword();
public abstract void setPassword(String s);
//Lifecycle Methods for EJB Container
/**
* Associate this bean instance with a particular context.
* Once done, we can quiery the Context for environment info via properties.
* @param EntityContext
*/
public void setEntityContext(EntityContext ctx) {}
/**
* Disassociate this bean instance with a particular context.
*/
public void unsetEntityContext() {}
/**
* Called after activating this instance.
* Placeholder - should acquire needed resource here.
*/
public void ejbActivate() {}
/**
* Called before passivating this instance.
* Placeholder - should release any acquired resources here.
*/
public void ejbPassivate() {}
/**
* Save values to DB.
* Placeholder - should do any needed pre-processing here.
*/
public void ejbStore() {}
/**
* Load values from DB.
* Placeholder - should do any needed post-processing here.
*/
public void ejbLoad() {}
/**
* To create a new record.
* We just take in the firstname, lastname, identifier and password.
* @param String firstname
* @param String lastname
* @param String identifier
* @param String password
* @return String - must return 'null' primary key class
* @throws CreateException
*/
public String ejbCreate(String firstname, String lastname, String identifier, String password)
throws CreateException {
setFirstname(firstname);
setLastname(lastname);
setIdentifier(identifier);
setPassword(password);
return null;
}
/**
* To associate the newly created record with its own EJBObject.
* Placeholder - should do any needed post-processing here.
* @param String firstname
* @param String lastname
* @param String identifier
* @param String password
* @throws CreateException
*/
public void ejbPostCreate(String firstname, String lastname, String identifier, String password)
throws CreateException {
}
/**
* To delete record from DB.
*/
public void ejbRemove() {}
}