KickJava   Java API By Example, From Geeks To Geeks.

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


1 package example.cmp.id;
2
3 /**
4  * Implementation class for the Student bean.
5  *
6  * <p>Each instance of StudentBean maps to a table entry of "id_students".
7  *
8  * <p>Each Student may have an associated Quidditch entry if the
9  * Student is on the house team. Since the Quidditch entry is
10  * an identifying relation, there is no corresponding entry in the SQL.
11  *
12  * <p>StudentBean is abstract since it's taking advantage of container-managed
13  * persistence. Resin-CMP will create the implementation of the abstract
14  * methods.
15  *
16  * <p>StudentBean also takes advantage of the AbstractEntityBean
17  * implementation. AbstractEntityBean is just a stub
18  * EntityBean implementation with default methods to make life
19  * a little more sane for simple beans.
20  *
21  * <p>This CMP bean uses the following schema:
22  *
23  * <code><pre>
24  * CREATE TABLE id_students (
25  * name VARCHAR(250) NOT NULL,
26  *
27  * PRIMARY KEY(name)
28  * );
29  * </pre></code>
30  */

31 abstract public class StudentBean extends com.caucho.ejb.AbstractEntityBean {
32   /**
33    * Returns the name of the student. The name is also the primary
34    * key as defined in the deployment descriptor.
35    */

36   abstract public String getName();
37   /**
38    * Returns the student's <code>Quidditch</code> statistics, if the
39    * student is on the house team.
40    */

41   abstract public Quidditch getQuidditch();
42 }
43
Popular Tags