1 Reply Latest reply on Feb 7, 2003 3:01 PM by adrian.brock

    can relationship include the subclasses?

    isabella

      hello,

      thx alot for the quick reply to my previous questions, they really helped solving part of the JBOSS mystery in my mind ^_^"

      now i have another problem:

      say i have an entity bean called BEAN, and another entity bean BEAN_PARTNER, they have a 1:1 relationship, ie, each BEAN has got a BEAN_PARTNER.

      now i have another bean BEAN_SON which extends BEAN, i found from trial (i did include the get/set methods in the local interface....) that i cannot set a BEAN_PARTNER for BEAN_SON, as has been possible for BEAN, its superclass....

      i would like to know, can such relationship include the sublcasses by any means?

      thx in advance,
      isabella~

        • 1. Re: can relationship include the subclasses?

          CMP/CMR caters for what would be possible
          in the underlying persistent store.

          For a DB, you cannot define a constraint on a table
          BEAN_PARTNER that relates to two other tables
          BEAN/BEAN_SON using one column.
          Relational constraints are not polymorphic.

          You can include a relation between BEAN and BEAN_SON
          where BEAN_SON holds a link to a BEAN and then defines
          extra columns. The relation to BEAN_PARTNER is then
          stored only in the BEAN table.

          Regards,
          Adrian