0 Replies Latest reply on Jun 9, 2004 4:26 PM by lafr

    CMR-problem with existing db-schema

    lafr

      I want to create EB's for existing tables representing a SalesOrder.
      The head-table is called so_head, the positions are in so_pos and additional data for the positions is in so_posp.
      so_head has field order_id as PK, so_pos has pos_id as PK and order_id as FK.
      so_posp does not have pos_id but order_id+pos_id+counter as PK.

      First I created two CMP beans with a CMR for so_head and so_pos via field order_id -> OK, no problem !
      Then another CMP bean for table so_posp with a CMR to so_pos via fields order_id+pos_id.
      JBoss complains, that the bean for so_pos has no CMP-field named order_id.
      This is somehow correct, but it's added as a result of the relation between so_head and so_pos.

      Is there a solution for this database schema ?

      If not, is it possible to use a view as database object for an entity bean ?