1 Reply Latest reply on May 15, 2003 6:29 PM by Robert de Lorimier

    PLEASE SOMEONE! How can I make CMP2.0 use existing foreign k

    bikerbiker Newbie

      Hi all yo,
      My problem is, that when my app is going to perform first calling over entity bean, MySQL throws sqlException : Column blabla defined twice.
      blabla means existing FK column in DB

      Conditions:
      The current entity beans are using CMR of <foreign-key-mapping> type (one2many), where in "key-filds" element is in "column-name" specified name of !!existing FK column in DB! !

      I believe that <foreign-key-mapping> relation type is after first deployment of EJB trying to alter table with adding the column of type corresponding to the preceding field specified by<field-name> in <key-fields>.

      I would like to know how can I disable this function like it is possible in <relation-table> type mapping CMR,where you can make CMP2.0 use existing relation table.

      Possible solutions? :
      1)is there any secret XML clause something like
      <key-fields>
      .................
      <create-FK-column>false</create-FK-column>
      </key-fields>

      2)JBoss must somewhere persist information about first altering db table?It could be manualy rewritable?

      3)Is the fuck JBoss able to make Entity EJB tier over existing DB application? (Using CMRs)