0 Replies Latest reply on Nov 25, 2003 8:24 PM by abuayyub

    ejbql query recieved  mysql

    abuayyub

      hi, i hava a strange problem that i can't find an answer to. the mysql database i am using is version 4.0.14. i am using jboss version 3.2.2RC2.
      i am using xdoclet 1.1.2 and ant1.5 to generate and build interfaces and descripters.

      i created an CMP ejb with a finder method having the following query: SELECT OBJECT(o) FROM client as o WHERE o.first_Name = ?1 and o.last_Name = ?2

      i get the following error visible in the window where jboss was started:

      01:26:36,062 INFO [STDOUT] Call find by full name
      01:26:36,082 INFO [STDOUT] ERROR caught exception Find failed: java.sql.SQLException:
      Syntax error or access violation, message from server:
      "You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server
      version for the right syntax to use near 'FROM client t0_o WHERE t0_o.first_name = 'jim'
      AND t0_o.last_name = jones"01:26:36,112

      on execution i get the following query in the mysql database trace file:

      do_command: info: Command on TCP/IP (17580) = 3 (Query)
      dispatch_command: query: SELECT FROM client t0_o WHERE t0_o.first_name = 'jim' AND t0_o.last_name = 'jones'
      net_printf: enter: message: 1064
      vio_is_blocking: exit: 1


      what i can see is the OBJECT(o) in the ejbql has no representation when passed to the database. any ideas on how to fix this or do i need to do something else?

      the abstract schema is client and this is the relevent extract from the generated ejb-jar file :


      <query-method>
      <method-name>findByFullName</method-name>
      <method-params>
      <method-param>java.lang.String</method-param>
      <method-param>java.lang.String</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(o) FROM Client o WHERE o.firstName = ?1 and o.lastName=?2]]></ejb-ql>