0 Replies Latest reply on May 20, 2013 9:46 PM by Hanine Hanynowsky

    No support for Many to Many Join Table with additional business fields

    Hanine Hanynowsky Newbie

       

      If you happen to have a Many to Many join table that has additional fields, Forge generates the entity for this join table as well as the corresponding EmbeddedId class (Composite Primary key) and thus the its UI that lets the user manually populate the join table with the corresponding values. However it fails since, there is no support for the EmbeddedId (Embeddable Id)  - Populates a Null value for ids -

       

      Lets say we have the following use case :

       

      |EXPERTISE          |

      |id: BIGINT             |

      |domain_id: BIGINT |

                1   

                |

                |         

                m

      |EXPERTISE_BOOK   |

      | expertise_id: BIGINT |

      |book_id: BIGINT        |

      |isAcademic: BOOL    |

                m

                |

                |

                1

      |BOOK     |

      |id:BIGINT|

       

      Forge would generate an entity for EXPERTISE_BOOK having an Embedded ID which is of Type EmbeddedId (a Class generated to hold the values of the composite primary key : expertise_id &book_id in EXPERTISE_BOOK).

      Forge would also generate a separate UI for this same join table that lets the user manually link a BOOK with an EXPERTISE and sepcifiy the value of isAcademic field. However the user won't be able tosubmit the insert because Entities with Embedded ID are not supported on the View layer (Forge uses Java Long type for Ids and not yet Types of EmbeddedId Classes).

       

      Normally, Forge shouldn't generate en a separate UI for the M2M table, but still allow the user to Create a BOOK, Pick one EXPERTISE with the corresponding value of isAcademic Field and add it to the BOOK, repeat this operation if the user needs to add a list of Expertises and then create or Edit, on the same page: I am talking about the join table with additional business fields!