• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

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
 
please buy my thing and then I'll have more money:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic