Unfortunatly for you, ORDER BY is not part of the EJB-QL 2.0 spec. Only in EJB-QL 2.1 available only on the JBoss 4.X.X series.
Thanks for your reply.
you mean the only choice is to use JBoss 4.X.X if I want to sort?
it is a very strange isn't it?
JBoss is not guilty for that point. EJB-QL is part of the EJB 1.4 spec from SUN. JBoss 4.X.X series is designed to be compliant with this spec release.
But, you have a solution (from JBoss):
If you have bought the JBoss doco, you are aware that JBoss allows to override EJB-QL queries with JBOSS-QL. ORDER BY is vailable in JBOSS-QL in 3.2.X series.