Win a copy of Fixing your Scrum this week in the Agile forum!
  • 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
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

is this orderby query right? as i am getting an error

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the query:
<query>
<query-method>
<method-name>findAllWithConstraint</method-name>
<method-params/>
</query-method>
<ejb-ql><![CDATA[SELECT OBJECT(o) FROM users AS o ORDERBY o.iD
DESC]]></ejb-ql>
</query>
This is the error:
weblogic.ejb20.cmp.rdbms.finders.IllegalExpressionException:
While trying to process Finder
Method Name: findAllWithConstraint
Parameter Types: ()
EJB Query: SELECT OBJECT(o) FROM users AS o ORDERBY o.iD DESC
)
Could not parse EJB QL expression: SELECT OBJECT(o) FROM users AS o
ORDERBY o.iD DESC
Please tell me the problem with this query
Ronak Parekh
 
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is no support for ORDER BY CLAUSE in EJBQL.
 
Pradeep bhatt
Ranch Hand
Posts: 8944
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ORDER BY clause is supported in EJB 2.1
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You have a few choices:
  • Use a proprietary extenstion to CMP like WLQL.
  • Sort the Collection or Set after it is returned.
  • Skip CMP altogether and just use Session + DAO for those queries that don't map nicely.


  • CMP does not cover everything that you could possibly need. It does however get you 80% to 90% of the way there in most cases. For those exceptions there is always DAO.
     
    You guys haven't done this much, have ya? I suggest you study this tiny ad:
    the value of filler advertising in 2021
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic