EJB (2.0) Inheritance & Relationships


EJB design: EJB (2.0) Inheritance & Relationships

  1. Hi,

    I'd like to know if the relationships in the base Entitybean are seen in the child bean.

    For example, a Person Bean has many Contact points. (1-M) A Person could be a Student or a Professional. Will I be able to see the relationship of ContactPoints in the Student bean?

  2. Because a Student is a subclass of Person, you inherit everything from Person. This would then denote that you would definitely see the ContactPoints of a Person from within a Student.
  3. Hi Bruce,

    I'm having problems when I run the ejbc on WLS 6.0 SP1.
    ejbc complains that: 'The entity bean contains an
    extra abstract method.' which is the get/setContactPoints.

    I've defined the CMR on Person to ContactPoints & have
    the relationships defined for Person but not for Student.

    Do I need to repeat the relationship for Student bean in
    the deployment descriptor in the ejb-jar.xml as I've done
    for Person Bean-ContactPoints.