4 Replies Latest reply on Aug 13, 2002 1:11 AM by dsundstrom

    Postgres: unknown query????

    kiuma

      Hello everybody, I'm having the following problem:

      I've a customer class that seems to be well bound to my datasource; in fact whent I call the findAll() method it works pretty well.

      The problem is when I try to call methods like findCustomerByName(lastName, firstName);

      I'm using a modified version of the template project given with Jboss.

      So the piece of code declaring the implied piece of code of my EntityBean file is :

      *
      * @ejb:finder signature="java.util.Collection findAll()"
      *
      * @ejb:finder signature="java.util.Collection findCustomerByName( java.lang.String pLastName, java.lang.String pFirstName )"
      *
      * @jboss:finder-query name="findCustomerByName"
      * query="lastName = {0} AND firstName = {1}"
      *

      but the result of my jsp page, which uses a session bean mapped on Customer's one says:
      ----------------------------------------------------------
      Web Client

      The next ID of a Test Entity is:


      Tehere are 1 curomers.

      Customers retrived are:.
      Chiumenti Andrea
      Now I try to find a customer for name with criteria:
      lastName = Chiumenti
      firstName = Andrea

      Caugth exception: Customer not found: Unknown query: public abstract java.util.Collection com.wingstech.webappointments.interfaces.CustomerHome.findCustomerByName(java.lang.String,java.lang.String) throws java.rmi.RemoteException,javax.ejb.FinderException; nested exception is: javax.ejb.EJBException: Customer not found: Unknown query: public abstract java.util.Collection com.wingstech.webappointments.interfaces.CustomerHome.findCustomerByName(java.lang.String,java.lang.String) throws java.rmi.RemoteException,javax.ejb.FinderException


      Have fun and see you soon

      ----------------------------------------------------------

      Can you kindly tell me why this message and how can I correct my mistake?

      Thanks in advance,
      Kiuma

        • 1. Re: Postgres: unknown query????
          dsundstrom

          I don't know XDoclet well, but I don't see any EJB-QL in this post.

          • 2. Re: Postgres: unknown query????
            kiuma

            thanks it's that

            • 3. Re: Postgres: unknown query????
              sherlock

              Hi,
              currently I am struggling with the similar problem.
              However looking at the XDoclet sources I've discovered undocumented(?) @jboss:declared-sql tag:
              Sample usage:
              /**
              @jboss:declared-sql
              * signature="<complete finder method signature, like: java.util.Collection findMethod(String parameter1, int parameter2)>"
              * where="<here goes SQL WHERE clause>"
              * order="<here goes SQL ORDER BY clause>"
              */
              You can discover this looking at xdoclet/ejb/vendor/jbosscmp-jdbc_xml.j in xdoclet.jar.

              Hope this helps
              sherlock

              • 4. Re: Postgres: unknown query????
                dsundstrom

                Use the xdoclet standard ejb-ql tags instead of the jboss declared-sql tags. Also I think they are undocumented, because they are still a work in progress.