KickJava   Java API By Example, From Geeks To Geeks.

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


1 package example.cmp.many2one;
2
3 /**
4  * Implementation of the StudentBean. Each instance of StudentBean
5  * maps to a table entry of "student", where student is defined as
6  *
7  * <pre>
8  * CREATE TABLE student_house (
9  * name VARCHAR(250) NOT NULL,
10  * house VARCHAR(250),
11  *
12  * PRIMARY KEY(name)
13  * )
14  * </pre>
15  *
16  * <p/>StudentBean is abstract since it's taking advantage of container-managed
17  * persistence. Resin-EJB will create the implementation of the abstract
18  * methods.
19  *
20  * <p/>StudentBean also takes advantage of the AbstractEntityBean
21  * implementation. AbstractEntityBean is just a stub
22  * EntityBean implementation with default methods to make life
23  * a little more sane for simple beans.
24  */

25 abstract public class StudentBean extends com.caucho.ejb.AbstractEntityBean {
26   /**
27    * Returns the student name. The name is the primary key.
28    */

29   abstract public String getName();
30   /**
31    * Returns the house the student belongs to.
32    */

33   abstract public House getHouse();
34   /**
35    * Sets the student's house.
36    */

37   abstract public void setHouse(House house);
38 }
39
Popular Tags