2 Replies Latest reply on Feb 9, 2003 12:19 PM by ABAZIOU

    EJB QL failed ...

    Rafal Kedziorski Novice

      Hallo,

      in my ejb-jar.xml I defined:

      <!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>
      <enterprise-beans>

      <display-name>Firm Entity Bean</display-name>
      <ejb-name>FirmBean</ejb-name>
      <local-home>FirmLocalHome</local-home>
      FirmLocal
      <ejb-class>FirmBean</ejb-class>
      <persistence-type>Container</persistence-type>
      <prim-key-class>java.lang.Long</prim-key-class>
      True
      <cmp-version>2.x</cmp-version>
      <abstract-schema-name>FirmBean</abstract-schema-name>
      <cmp-field><field-name>firm_id</field-name></cmp-field>
      <cmp-field><field-name>name</field-name></cmp-field>
      <primkey-field>firm_id</primkey-field>

      <query-method>
      <method-name>findByName</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(o) FROM firm o WHERE o.name = ?1]]></ejb-ql>


      </enterprise-beans>
      </ejb-jar>

      After start JBoss I get this error:

      Was expecting one of:
      "IN" ...
      <ABSTRACT_SCHEMA> ...
      )]

      My Table hat firm_id as PK (NUMERIC(20)) and name (VARCHAR(40)). I don't understand, why should I use IN in my EJB QL? I don't get any collection. Only one row.


      Best Regards,
      Rafal