1 Reply Latest reply on Nov 12, 2004 4:04 AM by Alexey Loubyansky

    Wrong SQL generated for CMP

    Oliver Ebeling Newbie

      Hi,

      I try to write a simple CMP-EJB to read some data from our DB2-host-databases.
      But the generated SQL is wrong, it's:

      SELECT FROM DRTADM.VRZV2FA1 t0_Vermittler WHERE
      .
      In result I get an javax.ejb.FinderException.

      I've double checked everything and searched the whole web for an answer, without finding a solution.
      Please help!

      My ejb-jar.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
      <ejb-jar>
       <description>JBoss Basis Application</description>
       <display-name>Versicherung EJBs</display-name>
       <enterprise-beans>
       <entity>
       <!-- Vermittler -->
       <display-name>Vermittler Entity Bean</display-name>
       <ejb-name>Vermittler</ejb-name>
       <home>de.deutscherring.versicherung.vermittler.ejb.VermittlerHome</home>
       <remote>de.deutscherring.versicherung.vermittler.ejb.Vermittler</remote>
       <local-home>de.deutscherring.versicherung.vermittler.ejb.VermittlerLocalHome</local-home>
       <local>de.deutscherring.versicherung.vermittler.ejb.VermittlerLocal</local>
       <ejb-class>de.deutscherring.versicherung.vermittler.ejb.VermittlerBean</ejb-class>
       <reentrant>False</reentrant>
       <persistence-type>Container</persistence-type>
       <cmp-version>2.x</cmp-version>
       <abstract-schema-name>vermittler</abstract-schema-name>
       <prim-key-field>vermittlerNummer</prim-key-field>
       <prim-key-class>java.lang.Integer</prim-key-class>
       <cmp-field><field-name>vorname</field-name></cmp-field>
       <cmp-field><field-name>nachname</field-name></cmp-field>
       <cmp-field><field-name>vermittlerNummer</field-name></cmp-field>
       </entity>
       </enterprise-beans>
      </ejb-jar>
      


      My jbosscmp-jdbc.xml:
      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC
       "-//JBoss//DTD JBOSSCMP-JDBC 3.0//EN"
       "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_0.dtd">
      <jbosscmp-jdbc>
       <enterprise-beans>
       <entity>
       <ejb-name>Vermittler</ejb-name>
       <datasource>java:/AMADEUS</datasource>
       <datasource-mapping>DB2</datasource-mapping>
       <create-table>false</create-table>
       <remove-table>false</remove-table>
       <read-only>true</read-only>
       <table-name>DRTADM.VRZV2FA1</table-name>
       <cmp-field>
       <field-name>nachname</field-name>
       <column-name>NAME</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>vorname</field-name>
       <column-name>VORNAME</column-name>
       </cmp-field>
       <cmp-field>
       <field-name>vermittlerNummer</field-name>
       <column-name>VMNR</column-name>
       </cmp-field>
       </entity>
       </enterprise-beans>
      </jbosscmp-jdbc>