KickJava   Java API By Example, From Geeks To Geeks.

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


1 package example.cmp.ejbql;
2
3 import java.util.Collection;
4
5 /**
6  * Implementation class for the Student bean.
7  *
8  * <p>Each instance of StudentBean
9  * maps to a table entry of "one2many_students", where student is defined.
10  *
11  * </p>StudentBean is abstract since it's taking advantage of container-managed
12  * persistence. Resin-CMP will create the implementation of the abstract
13  * methods.
14  *
15  * <p/>StudentBean also takes advantage of the AbstractEntityBean
16  * implementation. AbstractEntityBean is just a stub
17  * EntityBean implementation with default methods to make life
18  * a little more sane for simple beans.
19  */

20 abstract public class StudentBean extends com.caucho.ejb.AbstractEntityBean {
21   /**
22    * Returns the name of the student (CMP field). The name is also the primary
23    * key as defined in the deployment descriptor.
24    */

25   abstract public String getName();
26   /**
27    * Returns the gender of the student (CMP field).
28    */

29   abstract public String getGender();
30   /**
31    * Sets the gender of the student (CMP field).
32    */

33   abstract public void setGender(String gender);
34
35   /**
36    * Returns a <code>Collection</code> of all Courses that the student is
37    * currently enrolled in (CMR field).
38    */

39   abstract public Collection getCourseList();
40
41   /**
42    * returns the <code>House</code> that this Student belongs to (CMR field).
43    */

44   abstract public House getHouse();
45
46   /**
47    * sets the <code>House</code> that this Student is to belong to (CMR field).
48    *
49    * @param house new House that this Student will belong to.
50    */

51   abstract public void setHouse(House house);
52 }
53
Popular Tags