Writing an Entity Bean
Implement the EntityBean interface
- ejbActivate() -- called on activation
- ejbPassivate() -- called on passivation
- ejbLoad() -- tells bean to load state from database
- ejbStore() -- tells bean to store state in database
- ejbRemove() -- called when client calls remove()
- setEntityContext() -- called by container when instance has been created
- unsetEntityContext() -- called by container before removing the instance
- must also implement ejbFind() -- allows client to look up EJB objects
Optionally implement create() methods
Create remote interface
- must extend javax.ejb.EJBObject interface