7 Replies Latest reply on Jan 16, 2003 7:01 PM by Loren Rosen

    Multi-part primary key - How?

    Lewis Henderson Novice

      Hi,

      I have spent a couple of days trying to do a simple(ish) one to many relationship. All examples that I have seen use a single unique key field in the child table.

      I have two tables (all String columns) :-

      T1
      id
      name

      T2
      id
      ref
      description

      I have a primary key class (T2PK) containing 'id' and 'ref' (id + ref = unique). In my T2EJB I have an ejbCreate(String id, String ref). I create T2EJB's from inside T1EJB calling the create above.

      Could someone please describe/point me in the direction of some docs explaining how to setup ejb-jar.xml and jbosscmp-jdbc.xml to do this? I have tried with varying degrees of success to get it done.

      P.S. I found that switching log4j to debug for 'org.jboss.ejb.plugins.cmp.jdbc' tells me when/if I'm getting close!


      Thanks

      Lewis