KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > test > ejb > BaseEntityBean


1 package test.ejb;
2
3 import javax.ejb.*;
4
5 /**
6  * SuperClass for all entity beans, implementing common entity bean methods.
7  *
8  * @author <a HREF="mailto:youremail@yourdomain.com">youremail@yourdomain.com</a>
9  * @version $Revision: 1.6 $
10  */

11 public abstract class BaseEntityBean {
12     /** Reference to EntityContext. */
13     protected EntityContext entityContext = null;
14
15     /**
16      * The creation-date of the entity. This field is purely to track when
17      * this entity was created, and should be set in ejbCreate
18      * (<code>setCreationDate(new Date());</code>.
19      * It is not included in the value object.
20      *
21      * <p>We use the qualified name here because XDoclet doesn't copy imports from
22      * base classes into the generated interfaces.</p>
23      *
24      * @ejb.persistence column-name="creationDate"
25      * @ejb.interface-method
26      *
27      * @ejb.value-object exclude="true" match="*"
28      *
29      */

30     public abstract java.util.Date JavaDoc getCreationDate();
31
32     /** @ejb.interface-method */
33     public abstract void setCreationDate(java.util.Date JavaDoc creationDate);
34
35     /**
36      * Gets the EntityContext. To be used by classes extending this.
37      * @return the EntityContext of the EJB
38      */

39     protected EntityContext getEntityContext() {
40         return entityContext;
41     }
42
43     /** Required to implement EntityBean. Sets the EntityContext. */
44     public void setEntityContext(EntityContext entityContext) throws EJBException {
45         this.entityContext = entityContext;
46     }
47
48     /** Required to implement EntityBean. Sets the EntityContext to null. */
49     public void unsetEntityContext() throws EJBException {
50         entityContext = null;
51     }
52
53     /** Required to implement EntityBean. Not implemented. */
54     public void ejbActivate() throws EJBException { }
55
56     /** Required to implement EntityBean. Not implemented. */
57     public void ejbPassivate() throws EJBException { }
58
59     /** Required to implement EntityBean. Not implemented. */
60     public void ejbLoad() throws EJBException { }
61
62     /** Required to implement EntityBean. Not implemented. */
63     public void ejbStore() throws EJBException { }
64
65     /** Required to implement EntityBean. Not implemented. */
66     public void ejbRemove() throws RemoveException, EJBException { }
67 }
Popular Tags