0 Replies Latest reply on Sep 15, 2004 9:26 AM by soulgod

    ejb 2.0 cmp and mysql in Jbuilder running on Jboss, strange

    soulgod Newbie

      i have an employee wich is an table in a mysql database, i create the entity bean by the table model, when i try to get something with findbyPrimaryKey i get an error , database is filled with right data

      java.sql.SQLException: Column not found, message from server: "Unknown column 't0_Employess.Employees_upk' in 'field list'

      the jbosscmp-jdbc.xml :
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">
      <jbosscmp-jdbc>

      java:DataSource
      <datasource-mapping>mySQL</datasource-mapping>

      <enterprise-beans>

      <ejb-name>Employees</ejb-name>
      <table-name>employees</table-name>
      <cmp-field>
      <field-name>matricule</field-name>
      <column-name>matricule</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>departmentsId</field-name>
      <column-name>departments_id</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>cardid</field-name>
      <column-name>cardid</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>firstname</field-name>
      <column-name>firstname</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>lastname</field-name>
      <column-name>lastname</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>loginname</field-name>
      <column-name>loginname</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>password2</field-name>
      <column-name>password2</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>regime</field-name>
      <column-name>regime</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>functiontitle</field-name>
      <column-name>functiontitle</column-name>
      </cmp-field>


      <ejb-name>Departments</ejb-name>
      java:DataSource
      <datasource-mapping>mySQL</datasource-mapping>
      <table-name>departments</table-name>
      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>
      </cmp-field>
      <cmp-field>
      <field-name>name</field-name>
      <column-name>name</column-name>
      </cmp-field>

      </enterprise-beans>
      </jbosscmp-jdbc>