2 Replies Latest reply on Jan 29, 2003 3:56 PM by hooligan495

    Finder Exceptions, unknown queries and trying to use xdoclet

      Hey,

      My brain is really hurting. I downloaded the template example to get up and running with Jboss and learning EJB. After reading many books, buying the JBoss manuals (the CMP one is good). I got an example up and running with XDoclet 1.1, jboss 3.0.2, and ant 1.5.

      It works sweet. Until I decided I needed to fit an ORDER BY clause into one of my finders. Then it all goes downhill. For some reason I just can't seem to get XDoclet to create the JBossQL query in the jbosscmp-jdbc.xml.

      here is my finder method pre-attempt at order by.
      * @ejb:finder signature="java.util.Collection findByTasting(java.lang.Integer tasting)"
      * query="SELECT OBJECT(s) FROM ResultsSchema AS s WHERE s.tastingId = ?1"


      I tried something like:
      * @ejb:finder signature="java.util.Collection findByTasting(java.lang.Integer tasting)"
      * @jboss:finder-query="tastingId = {0}" order="score"


      and the query drops into the jaws.xml file.

      I saw a reference in these forums to using @jboss:declared-sql (even tho it's not in the XDoclet 1.1 documentation and low and behold it puts the query in the jbosscmp-jdbc.xml file but I get errors on deployment

      * @ejb:finder signature="java.util.Collection findByTasting(java.lang.Integer tasting)"
      * @jboss:declared-sql signature="java.util.Collection findByTasting(java.lang.Integer tasting)" where="tastingId = {$1}" order="score"


      errors:

      org.jboss.deployment.DeploymentException: Unknown query method : public abstract java.util.Collection wine.interfaces.ResultsEJBLocalHome.findByTasting(java.lang.Integer) throws javax.ejb.FinderException


      I am not sure what is happening here.

      Can anyone at all shed some light? I've been up and down the XDoclet forums to no avail.
      Is it just not possible to get this working with xdoclet1.1?

      I am in the process of trying to upgrade to XDoclet 1.2beta1 to see how this works but I am running into all sorts of headaches there. Has anyone successfully upgraded the template to use xdoclet 1.2 beta 1(or2)?

      Thanks for your help!
      Jay

        • 1. Re: Finder Exceptions, unknown queries and trying to use xdo

          I got it working!!! woo hoo. It involved me upgrading to XDoclet 1.2b2 and getting it working. From there it was just using the @jboss-query directive and setting up the query properly!

          Thanks for reading.

          One thing this recent exercise has done is really helped me understand how XDoclet is being used. Just taking the template and making it work isn't enough for true understanding :)


          Jay

          • 2. Re: Finder Exceptions, unknown queries and trying to use xdo

            I got it working!!! woo hoo. It involved me upgrading to XDoclet 1.2b2 and getting it working. From there it was just using the @jboss-query directive and setting up the query properly!

            Thanks for reading.

            One thing this recent exercise has done is really helped me understand how XDoclet is being used. Just taking the template and making it work isn't enough for true understanding :) (and I'm not trying to say that I am all the way to true understanding yet either ;) )


            Jay