|
| |
Find this tutorial in: /usr/local/resin/webapps/resin-doc/cmp/tutorial/cmp-one2one
Try the Tutorial
Scenario: At Hogwarts every Professor teaches one
Course. The Headmaster keeps track with two 1-1-related CMP
beans
This example focuses on:
- Establishing a one-to-one relationship between two entity beans
- Setting up the database for a one-to-one relationship
CourseBean.java
package example;
abstract public class CourseBean
extends com.caucho.ejb.AbstractEntityBean {
abstract public String getName();
abstract public Teacher getTeacher();
}
|
TeacherBean.java
package example;
abstract public class TeacherBean
extends com.caucho.ejb.AbstractEntityBean {
abstract public String getName();
abstract public Course getCourse();
}
|
Try the Tutorial
Copyright © 1998-2005 Caucho Technology, Inc. All rights reserved.
Resin® is a registered trademark,
and HardCoretm and Quercustm are trademarks of Caucho Technology, Inc. | |
|