com.opensymphony.ejb
Class EntityAdapter

java.lang.Object
  |
  +--com.opensymphony.ejb.AbstractEntityAdapter
        |
        +--com.opensymphony.ejb.EntityAdapter
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable

public abstract class EntityAdapter
extends AbstractEntityAdapter
implements javax.ejb.EntityBean

Abstract base adapter class to be extended by EJB EntityBeans.
Contains default implementations for all require methods to implement EntityBean.

To create an implementation of an Entity, extend this class and add appropriate ejbCreate(), ejbPostCreate() and getter/setter methods.

If an auto-generated primary key (long/int) is to be used,

Version:
$Revision: 1.15 $
Author:
Joe Walnes
See Also:
Serialized Form

Fields inherited from class com.opensymphony.ejb.AbstractEntityAdapter
context, sequenceName
 
Constructor Summary
EntityAdapter()
           
 
Method Summary
 void ejbActivate()
          Required to implement EntityBean.
 void ejbLoad()
          Required to implement EntityBean.
 void ejbPassivate()
          Required to implement EntityBean.
 void ejbRemove()
          Required to implement EntityBean.
 void ejbStore()
          Required to implement EntityBean.
protected  javax.ejb.EntityContext getEntityContext()
          Return EntityContext.
 void setEntityContext(javax.ejb.EntityContext context)
          Required to implement EntityBean.
 void unsetEntityContext()
          Required to implement EntityBean.
 
Methods inherited from class com.opensymphony.ejb.AbstractEntityAdapter
generateGUID, locatePropertySet, nextId, nextInt, nextLong, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityAdapter

public EntityAdapter()
Method Detail

setEntityContext

public void setEntityContext(javax.ejb.EntityContext context)
                      throws javax.ejb.EJBException,
                             java.rmi.RemoteException
Required to implement EntityBean. Sets the EntityContext. Also, attempts to detemine the sequenceName.
Specified by:
setEntityContext in interface javax.ejb.EntityBean

unsetEntityContext

public void unsetEntityContext()
                        throws javax.ejb.EJBException,
                               java.rmi.RemoteException
Required to implement EntityBean. Sets the EntityContext to null.
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        java.rmi.RemoteException
Required to implement EntityBean. Not implemented.
Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         java.rmi.RemoteException
Required to implement EntityBean. Not implemented.
Specified by:
ejbPassivate in interface javax.ejb.EntityBean

ejbLoad

public void ejbLoad()
             throws javax.ejb.EJBException,
                    java.rmi.RemoteException
Required to implement EntityBean. Not implemented.
Specified by:
ejbLoad in interface javax.ejb.EntityBean

ejbStore

public void ejbStore()
              throws javax.ejb.EJBException,
                     java.rmi.RemoteException
Required to implement EntityBean. Not implemented.
Specified by:
ejbStore in interface javax.ejb.EntityBean

ejbRemove

public void ejbRemove()
               throws javax.ejb.RemoveException,
                      javax.ejb.EJBException,
                      java.rmi.RemoteException
Required to implement EntityBean. Not implemented.
Specified by:
ejbRemove in interface javax.ejb.EntityBean

getEntityContext

protected javax.ejb.EntityContext getEntityContext()
Return EntityContext. To be used by classes extending this.

See www.opensymphony.com for more information.