2 Replies Latest reply on Jan 16, 2003 1:24 PM by frufox

    Mapping different column names in 1:1 CMR

    frufox

      Hello,

      I'm using JBoss 3.0.4 and I'm attemting to map two tables together in a one-to-one relationship where the mapped column names are different. I have successfully done this when the column names are the same. Also, I have bought both the JBoss3.x and JBossCMP documentation and I can not find any references for tackling this problem.

      Specifically I have two tables:

      USER
      --------
      USER_NAME (PK)
      FIRST_NAME
      .....

      TASK
      ----------
      TASK_ID (PK)
      ASSIGNEE_NAME
      ASSIGNOR_NAME
      ....

      I want to map the TASK table's ASSIGNEE_NAME to the USER table's USER_NAME (as well as the ASSIGNOR_NAME). I want these to be two separate CMR fields. I have appropriately set set the key-field property for other CMR relationships where the column names are the same but I can not find out where to specify the specific column name/CMP field name when the names differ. I'm not certain if this is a jbosscmp-jdbc or ejb-jar issue or if JBoss just assumes that the names are always the same.

      I'd really appreciate any help.

      Thanks,
      Brian