KickJava   Java API By Example, From Geeks To Geeks.

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


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

18 abstract public class StudentBean extends com.caucho.ejb.AbstractEntityBean {
19
20   /**
21    * Returns the student ID (which is also the primary key) of this student
22    * (CMP field).
23    */

24   abstract public int getId();
25   /**
26    * Sets the student ID (which is also the primary key) of this student
27    * (CMP field).
28    */

29   abstract public void setId(int id);
30   /**
31    * Returns the name of the student (CMP field). The name is also the primary
32    * key as defined in the deployment descriptor.
33    */

34   abstract public String getName();
35   /**
36    * Sets the name of the student.
37    */

38   abstract public void setName(String name);
39   /**
40    * Returns the gender of the student (CMP field).
41    */

42   abstract public String getGender();
43   /**
44    * Returns the password associated with this student.
45    */

46   abstract public String getPassword();
47   /**
48    * Sets the gender of the student (CMP field).
49    */

50   abstract public void setGender(String gender);
51   /**
52    * Returns a <code>Collection</code> of all Courses that the student is
53    * currently enrolled in (CMR field).
54    */

55   abstract public Collection getCourseList();
56 }
57
Popular Tags