1 Reply Latest reply on May 13, 2002 8:26 PM by Dain Sundstrom

    CMP problem with field to column name mapping.

    Dag Naess Newbie

      Hi all!

      First the technicals:
      jboss3.0.0RC3
      jdk 1.4.0
      Red Hat 7.2
      Postgres datasource.

      I'm having problems with the CMP generated sql. I have an entity bean kalled Gruppe. Each time I do a create() on its home interface CMP produces sql like this.

      INSERT INTO Gruppe (konto,superGruppe,id) VALUES (?,?,?)

      This leads to an SQLException because my collumnames is konto_id, superGruppe_id and gruppe_id.

      Why the field-name and not the collumn-name shows up in the CMP generated sql I don't understand beacuse in my jbosscmp-jdbc.xml I do:

      <cmp-field>
      <field-name>id</field-name> <column-name>gruppe_id</column-name></cmp-field>
      <field-name>konto</field-name> <column-name>konto_id</column-name></cmp-field>
      <cmp-field><field-name>superGruppe</field-name>< <column-name>super_gruppe_id</column-name></cmp-field>

      As far as i can tell the datasource is correct because i kan read/write to non-CMP tables. And I've checked that the jbosscmp-jdbc.xml conforms to the dtd that followed my RC3 checkout. (If there were errors in the jbosscmp.jdbc.xml It would have caused deployment errors, wouldn't it ?)

      Oh and yes, like everybody else I'm in a hurry. Or more correct my employer is in a hurry, I would just like to know.

      Any Ideas, anyone ?