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

    Finder Exceptions, unknown queries and trying to use xdoclet

    Jay McGaffigan Newbie


      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"


      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!