KickJava   Java API By Example, From Geeks To Geeks.

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


1 package example.cmp.select;
2
3 import java.util.Collection;
4
5 /**
6  * Implementation class for the Student bean.
7  *
8  * <code><pre>
9  * CREATE TABLE select_student (
10  * name VARCHAR(250) NOT NULL,
11  * gender VARCHAR(6) NOT NULL,
12  * house VARCHAR(250) NOT NULL,
13  *
14  * PRIMARY KEY(name)
15  * );
16  * </pre></code>
17  *
18  * </p>StudentBean is abstract since it's taking advantage of container-managed
19  * persistence. Resin-CMP will create the implementation of the abstract
20  * methods.
21  *
22  * <p/>StudentBean also takes advantage of the AbstractEntityBean
23  * implementation. AbstractEntityBean is just a stub
24  * EntityBean implementation with default methods to make life
25  * a little more sane for simple beans.
26  */

27 abstract public class StudentBean extends com.caucho.ejb.AbstractEntityBean {
28   /**
29    * Returns the name of the student (CMP field). The name is also the primary
30    * key as defined in the deployment descriptor.
31    */

32   abstract public String getName();
33
34   /**
35    * Returns the gender of the student (CMP field).
36    */

37   abstract public String getGender();
38   /**
39    * Sets the gender of the student (CMP field).
40    */

41   abstract public void setGender(String gender);
42
43   /**
44    * returns the <code>House</code> that this Student belongs to (CMR field).
45    */

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

53   abstract public void setHouse(House house);
54 }
55
Popular Tags