resin-ee One-to-One Entity Relationship

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
tutorial client
package example; abstract public class CourseBean extends com.caucho.ejb.AbstractEntityBean { abstract public String getName(); abstract public Teacher getTeacher(); } package example; abstract public class TeacherBean extends com.caucho.ejb.AbstractEntityBean { abstract public String getName(); abstract public Course getCourse(); }