Sum is allowed to be used only in ejbSelect. And EJBQL query can return only EJB object, CMP field or EJBQL function result. As in the spec. 3.2.4 supports EJBQL-2.1.
Thanks, this helps me. I did't know that the newest versions are implementing EJB-QL 2.1.
I should read docs more often. :-(