2 Replies Latest reply on Apr 21, 2003 10:19 AM by Raja

    Help with EJB-QL needed!!! Wrong generated sql statement

    Thilko Richter Newbie


      Hi!

      I have the following problem. My ejb-jar.xml:


      <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(a) FROM StatusEntity AS a WHERE a.name= ?1]]></ejb-ql>


      and in my SessionEan I call the finder method like this:
      StatusEntityLocal local = home.findByName(statusValue.getName());

      I am using XDoclet to generate the ejb classes. When I execute the code, I ve got an db error that the sql statement was not finished. After I looked in the log, I saw that SQL generated by JBoss is like this:

      SELECT NAME FROM STATUS bla WHERE bla.NAME = ?

      So JBoss replaced the variable only with a ? ... What could I do?


      Regards,

      Thilko