aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes How to do orderBy with EJB (CMP)?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to do orderBy with EJB (CMP)??" Watch "How to do orderBy with EJB (CMP)??" New topic
Author

How to do orderBy with EJB (CMP)??

Long Huynh
Greenhorn

Joined: Jul 14, 2002
Posts: 7
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 ]

Long A. Huynh ( yes, as in the primitive 64 bit Long...lol)<br />SCJP2<br />"Got Java?"
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17250
    
    6

I am going to move this thread to a more appropriate forum, so that you can get answers quicker.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Dave Landers
Ranch Hand

Joined: Jul 24, 2002
Posts: 401
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

Joined: Oct 31, 2000
Posts: 160
Yes Dave is correct.
Order By is introduced in the EJB1.3
Chk the EJB 1.3 public draft
Rgds
-Siva
sivajag@hotmail.com


Rgds<p>--Siva Jagadeesan<br /><a href="http://java2simple.blog-city.com" target="_blank" rel="nofollow">http://java2simple.blog-city.com</a><br />Sun Certified Java2 Programmer<br />Sun Certified Web Component Developer<br />BEA Certified Weblogic Server 7 Enterprise Developer
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to do orderBy with EJB (CMP)??