1 Reply Latest reply on Nov 28, 2005 7:24 AM by Emmanuel Bernard

    ManyToMany Association Table with additional Columns

    Khoya Raaz Newbie

      Hello,
      I have a question about using an Association Table that includes additional columns. I have three tables in my DB and two entity beans:
      1) Language table and bean: it inlcudes a language id Primary key.
      2) Product table and bean: with Product id primary Key.
      3) Product_Lang table (no bean, as it is created by the App Server): This is the Association Table. It includes the 3 column languageId, ProductId and Description. languageId and ProductId are both primary keys in this table.
      The description column holds the Product description in different languages.
      I have setup a many-to-many association between Language Entity bean and Product Entity Bean, with Product_Lang as the association table.
      Questions:
      1) Is this set-up legit?
      2) How do I create set and get methods for Description (the whole point of this association is to get different language descriptions for each Product).
      3) If its not possible with a ManyToMany annotaion, how should I approach this.
      4) Do I have to set up a ManyToOne relationship between each Table and the Association table instead?

      I am developing an application to be launched early next year, and really need to get this working fast. Any advice will be greatly appreciated :), Thank you,
      Khoya.