KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > example > cmp > ejbql > CourseBean


1 package example.cmp.ejbql;
2
3 import java.io.Serializable;
4 import java.util.Enumeration;
5
6 import javax.ejb.*;
7 import javax.naming.InitialContext;
8 import javax.naming.NamingException;
9 import javax.sql.DataSource;
10
11 import com.caucho.ejb.AbstractEntityBean;
12
13 import java.util.Collection;
14
15 /**
16  * Implementation class for the Course bean.
17  * This is our implementation class. Its methods will be called only by the
18  * EJB container, and not ever by any client programs that we write.
19  * Instead, we call methods in the Remote Interface which will prompt the
20  * container to access methods in this class on our behalf. The container
21  * will also call the various housekeeping methods described below when it
22  * sees fit.
23  */

24 public abstract class CourseBean extends AbstractEntityBean {
25   /**
26    * CMP accessor and mutator methods are left for Resin-CMP to implement.
27    * Each cmp-field described in the deployment descriptor needs to be matched
28    * in the implementation class by abstract setXXX and getXXX methods. The
29    * container will take care of implementing them.
30    * Note that unless you make these methods available in the Local Interface,
31    * you will never be able to access them from an EJB client such as a servlet.
32    */

33   public abstract String getName();
34
35   /**
36    * CMP accessor and mutator methods are left for Resin-CMP to implement.
37    */

38   public abstract void setName(String val);
39
40   /**
41    * Returns a <code>Collection</code> of all Student who are currently
42    * enrolled in this Course.
43    */

44   abstract public Collection getStudentList();
45
46   /**
47    * returns the Teacher who is teaching this Course.
48    */

49   abstract public Teacher getTeacher();
50 }
51
Popular Tags