Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to do orderBy with EJB (CMP)??

 
Long Huynh
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is the correct statement to do orderBy in Oracle9i dev with EJB (CMP)?? I know this is possible with EJB (BMP).

thanks,
-AARON
[ July 25, 2002: Message edited by: Long Huynh ]
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am going to move this thread to a more appropriate forum, so that you can get answers quicker.
Mark
 
Dave Landers
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In EJB 2.0 CMP, you specify the query in ejb-jar.xml using EJB-QL. There is no ORDER BY in EJB-QL (yet - it is coming in EJB 2.1).
I know that Weblogic has an extention to EJB-QL that includes an ORDERBY keyword. Other appservers may do something similar, but I don't know.
If the ordering is important, you are stuck with BMP. Or you could do the ordering on the client using an appropriate Comparator with the Collection returned by the finder. Ugh.
 
Siva Jagadeesan
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes Dave is correct.
Order By is introduced in the EJB1.3
Chk the EJB 1.3 public draft
Rgds
-Siva
sivajag@hotmail.com
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic