KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

37   abstract public String getName();
38   /**
39    * Returns a map of the student's grades.
40    */

41   abstract public Map getGrades();
42 }
43
Popular Tags