2 Replies Latest reply on Feb 5, 2002 10:46 AM by Christopher Jozsa

    EJB-QL Finders in RH

    Christopher Jozsa Newbie

      First of all, are they implemented in JBoss3? I've been using the not-always-so-fresh cvs snapshots, but they don't seem to work at me.

      What I was trying, is to create a custom finder on a bean (eg. Manufacturer), to return all instances, sorted, based on it's 'name' field. As the first step, I've tried it without sorting, so just a basic EJB-QL query to return everything. I've used the following XDoclet tag:

      @ejb:finder signature="java.util.Collection findSortedAll()" result-type-mapping="Local" query="SELECT DISTINCT OBJECT(o) FROM MANUFACTURER AS o"

      ..which generated the following query into ejb-jar.xml:


      <query-method>
      <method-name>findSortedAll</method-name>
      <method-params></method-params>
      </query-method>
      <result-type-mapping>Local</result-type-mapping>
      <ejb-ql><![CDATA[SELECT DISTINCT OBJECT(o) FROM MANUFACTURER AS o]]



      Trying to deploy this bean, RH says:
      java.lang.NullPointerException
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.(JDBCEJBQLQuery.java:54)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:49)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:182)
      ..