2 Replies Latest reply on Nov 10, 2003 4:57 AM by nboz

    ejb-ql query ignored

    nboz Newbie

      Hi

      I have defined query in ejb-jar.xml like this:



      <query-method>
      <method-name>findByLast_sendtime</method-name>
      <method-params>
      <method-param>java.sql.Timestamp</method-param>
      </method-params>
      </query-method>
      <ejb-ql><![CDATA[SELECT OBJECT(h) FROM order h WHERE h.status = 'N' and last_sendtime < ?1]]></ejb-ql>


      and in Home interface like this:
      public Collection findByLast_sendtime(java.sql.Timestamp dt) throws RemoteException, FinderException;

      However jboss deploys it as (debug messages):
      2003-11-03 10:00:16,362 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] findByLast_sendtime SQL: SELECT orderid FROM order WHERE last_sendtime=?

      And tries to use it as:
      2003-11-03 10:38:06,378 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] findByLast_sendtime command executing: SELECT orderid FROM order WHERE last_sendtime=?
      2003-11-03 10:38:06,387 DEBUG [org.jboss.ejb.plugins.jaws.jdbc.JDBCCommand] Set parameter: idx=1, jdbcType=TIMESTAMP, value=2003-11-03 10:36:35.358

      what is wrong?

      JBoss version info:
      JBoss [WonderLand] 3.2.1 (build: CVSTag=JBoss_3_2_1 date=200305041533)

        • 1. Re: ejb-ql query ignored
          Juha Lindfors Master

          What about:
          SELECT OBJECT(h) FROM order AS h WHERE h.status = 'N' and h.last_sendtime < ?1

          does it make a difference?

          -- Juha

          • 2. Re: ejb-ql query ignored
            nboz Newbie

            > What about:
            > SELECT OBJECT(h) FROM order AS h WHERE h.status = 'N'
            > and h.last_sendtime < ?1
            >
            > does it make a difference?
            >
            > -- Juha

            Nope. But the problem solved: developer error ;)

            Apparently default ejb version is 1.1 and that doesnt support ejb-ql(?) so findBy* automagically constructs those finders and ignores all of my queries.

            .nboz