• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

ORDER BY clause in EJB QL valid for EJB2.0?

 
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am developing my CMP EJB's using EJB 2.0 Specification. In my one of CMP EJB there is a ejb-finder method with EJB QL as following:-
============================================================
"SELECT Object(b) FROM PartsMaster as b where b.partno like ?1 or b.description like ?2 ORDER BY ?3"
=============================================================
But when I am deploying my Bean to my application server (I am using JBOSS4.0), I am getting Error as follows:-
=======================================================
18:33:30,359 WARN [ServiceController] Problem starting service jboss.j2ee:jndiName=ejb/PartsDetail,service=EJB
org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'SELECT Object(b) FROM PartsMaster as b where b.partno like ?1 or b.description like ?2 ORDER BY ?3'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "3" at line 1, column 97.
Was expecting one of:
<NUMERIC_VALUED_PATH> ...
<STRING_VALUED_PATH> ...
<DATETIME_VALUED_PATH> ...
)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:52)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCCommandFactory.createEJBQLQuery(JDBCCommandFactory.java:60)
at org.jboss.ejb.plugins.cmp.jdbc.JDBCQueryManager.start(JDBCQueryManager.java:272)
=======================================================

However above EJB Query is working fine without "ORDER BY" Clause into it.

so Why I am getting this error when I am using ORDER BY in my EJB QL?
Is ORDER BY not available in EJB2.0 Spec?
please help me.
Thanx in advance.
Prash
 
Come have lunch with me Arthur. Adventure will follow. This tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic