3 Replies Latest reply on Aug 3, 2004 8:17 AM by hmae

    JBossQL and DynamicQL

    hmae

      To all,
      I was trying to implement a generic finder method that I found in :
      http://www.mailarchive.com/xdocletuser@lists.sourceforge.net/msg05474.html//www.mailarchive.com/xdocletuser@lists.sourceforge.net/msg05474.html
      The goal was to pass select statements that you define yourself. (My code is at the bottom.)

      When I deploy it, I get the error:
      11:04:49,055 WARN [verifier] EJB spec violation:
      Bean : DWMUsrAdmin
      Method : public abstract Collection findGeneric(String, Object;) throws FinderException, RemoteException
      Section: 10.5.6
      Warning: Every finder method except findByPrimaryKey(key) must be associated with a query element in the deployment descriptor.

      Since @jboss.query is set to dynamic I thought that the query will be overridden and having an empty query will not cause a problem. I checked the ejb-jar.xml and the only thing that might be a problem was: <ejb-ql><![CDATA[]]></ejb-ql>
      Is there something I am doing wrong?

      I am using JBoss 3.2.4.

      Thanks in advance for any help you can give me.


      I have the following in my Bean:
      /* @ejb.select
      * signature="java.util.Collection ejbSelectGeneric(java.lang.String query, java.lang.Object[] params)"
      * result-type-mapping="Local"
      * method-intf="LocalHome"
      * query=""
      * @jboss.query
      * dynamic="true"
      * signature="java.util.Collection ejbSelectGeneric(java.lang.String query, java.lang.Object[] params)"
      *
      */

      /**
      * @jboss.dynamic-ql
      */
      public abstract java.util.Collection ejbSelectGeneric ( java.lang.String jbossQl, java.lang.Object[] arguments ) throws FinderException;

      /**
      * @ejb.home-method
      * view-type="local"
      *
      **/
      public java.util.Collection ejbHomeFindGeneric(java.lang.String jbossQl, java.lang.Object[] parameters) throws FinderException{
      return ejbSelectGeneric(jbossQl, parameters);
      }

        • 1. Re: JBossQL and DynamicQL

          I have this working on several beans and the difference is that I do not have the ejb.select tag for the generic select, just the jboss.query node level tag, and for the method level tags on ejbSelectGeneric I have an ejb.interface-method tag instead of jboss.dynamic-ql.

          Then it works for me on JBoss 3.2.3

          Hope that helps,
          Mark

          • 2. Re: JBossQL and DynamicQL
            aloubyansky

            I think you should just rename the 'findGeneric' method on the home interface. As it is recognized as a finder method due to the 'find' prefix.

            • 3. Re: JBossQL and DynamicQL
              hmae

              Thank you for your replies. I tried both suggestions and it works now.