KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > example > TeacherBean


1 package example;
2
3 /**
4  * Implementation class for the Teacher bean.
5  *
6  * <p>This CMP bean uses the following schema:
7  *
8  * <pre><code>
9  * CREATE TABLE xone2one_teacher(
10  * name VARCHAR(250) NOT NULL,
11  * course VARCHAR(250) NOT NULL,
12  *
13  * PRIMARY KEY(name)
14  * );
15  * </code></pre>
16  *
17  * @ejb.bean name="teacher" view-type="local" type="CMP"
18  * reentrant="False" schema="courses" primkey-field="name"
19  * @ejb.pk class="java.lang.String"
20  * @ejb.home generate="local" local-class="example.TeacherHome"
21  * @ejb.interface generate="local" local-class="example.Teacher"
22  * @ejb.persistence table-name="xone2one_teachers"
23  */

24 abstract public class TeacherBean extends com.caucho.ejb.AbstractEntityBean {
25
26   /**
27    * returns the <code>Teacher</code>'s name
28    *
29    * @ejb.interface-method
30    * @ejb.persistence column-name="name"
31    * @ejb.pk-field
32    */

33   abstract public String getName();
34
35   /**
36    * returns the <code>Course</code> taught by the <code>Teacher</code>
37    *
38    * @ejb.interface-method
39    * @ejb.relation name="course-teacher"
40    */

41   abstract public Course getCourse();
42 }
43
Popular Tags