1 Reply Latest reply on Jun 17, 2003 12:23 PM by pdelgado0

    problem with SUM with EJB-QL.

      I have the following problem when this request : SELECT SUM(a.basePrice) FROM ProductBean AS a.


      18:30:37,171 ERROR [EntityContainer] Starting failed
      org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT SUM(a.basePrice) FROM ProductBean AS a'; - nested throwable: (org.jboss.ejb.
      lugins.cmp.ejbql.ParseException: Encountered "SUM" at line 1, column 8.
      Was expecting one of:
      "DISTINCT" ...
      "OBJECT" ...
      <NUMERIC_VALUED_PATH> ...
      <STRING_VALUED_PATH> ...
      <DATETIME_VALUED_PATH> ...
      <BOOLEAN_VALUED_PATH> ...
      <ENTITY_VALUED_PATH> ...
      <VALUE_CLASS_VALUED_PATH> ...
      )

      can you help me ?

      Thanks.

      Christophe.

        • 1. Re: problem with SUM with EJB-QL.
          pdelgado0

          I think the problem is that EJB 2.0 does not support the SUM arithmetic fuction (till now I think it only supports ABS and SQRT) so you have to wait until EJB 2.1 (Jboss 4.0 supports it) or maybe redefine your query using Jboss-ql. Perhaps jboss-ql supports SUM but I don't think so.