3 Replies Latest reply on Sep 9, 2003 2:42 PM by Juha Lindfors

    Relation when primary key column is not the same as foreign

    Alex Paransky Newbie

      I am wrapping JBOSS around existing database tables and ran into the following problem. I have a table called MEMBER, with MEMBER.ID being the primary key. I also have a table called AUTO with AUTO.OWNER_ID being a foreign key mapping to MEMBER.ID.

      I am trying to model a One (MEMBER) to Many (AUTO) relationship, however, I am not sure how to map this using JBOSSCMP-JDBC.XML file.

      From the documentation it seems like JBOSS would attempt to use column ID, in the AUTO table to represent foreign constraint, but I really want it to use OWNER_ID.

      Is there a way to work around this problem?


      Thanks.
      -AP_