1 Reply Latest reply on Apr 3, 2003 5:09 AM by lsloh

    How to specify this relation using jbosscmp-jdbc/xdoclet ?

    lsloh

      I have the following model :-
      ___________ __________________________
      | Customer|------ | Contact |
      | cust_id | 1 * | cont_id |
      -------------- | cont_type e.g. ship, bill |
      ---------------------------------

      So basically different types of contacts have the same fields. I have the following tables.

      customer----cust_id ------ contact
      cont_type
      cont_id

      I can do a m:n CMR relationship - but without contact type since it doesn't exist in Contact or Customer. Seems like I have to implement a EJB that models the relationship. Ideas for any other possibilities would be appreciated.

      Thanks.

      LS

        • 1. Re: How to specify this relation using jbosscmp-jdbc/xdoclet
          lsloh

          Sorry didn't preview, and the diagrams didn't come out right.

          customer (1) ------ (n) contact

          Contact has a "type" field to denote the type of contact e.g. shipping, billing, etc

          Tables are

          customer --- contact_customer --- contact

          where contact_customer has fields (contact id, customer id and contact type).

          Thanks.