2 Replies Latest reply on Jul 9, 2004 4:14 AM by jacerda

    [JBOSS-QL] COUNT on ejbSelect

    jacerda

      i can't put COUNT working :(

      need help.

      i have this

       * @jboss.query
       * signature = "Integer ejbSelectCountBetwenDates(java.sql.Timestamp ti, java.sql.Timestamp tf )"
       * query = "SELECT COUNT(o.facturaId) FROM Factura o WHERE o.data > ?1 AND o.data < ?2"
       *
      


      and

       /**
       *
       * @ejb.home-method view-type = "local"
       */
       public Integer ejbHomeCountBetwenDates(java.sql.Timestamp ti, java.sql.Timestamp tf) throws FinderException{
      
       return ejbSelectCountBetwenDates(ti,tf);
       }
      
      
       /**
       *
       * @param ti
       * @param tf
       * @return
       * @throws FinderException
       *
       * @ejb.select
       */
       public abstract Integer ejbSelectCountBetwenDates(java.sql.Timestamp ti, java.sql.Timestamp tf ) throws FinderException;
      
      


      and the error:

      java.lang.ClassCastException
       at com.multicert.project.datasystem.seef.ejb.FacturaCMP$Proxy.ejbSelectCountBetwenDates(<generated>)
       at com.multicert.project.datasystem.seef.ejb.FacturaBean.ejbHomeCountBetwenDates(FacturaBean.java:141)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1054)
      
      



      any help ??

      thanks in advance