Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ordering collection returned from a CMR Method

 
Tribhuvan Agarwal
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a CMR relationship with a 1 to many.
From that CMR method i get a collection.
That collection is not ordered. I need to get a ordered collection that is returned from that CMR Method. How to do this??
Is there any way to make that CMR method return sorted collection.
 
Pradeep bhatt
Ranch Hand
Posts: 8933
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The EJBQL in EJB 2.0 does not provide a support for this. EJB 2.1 does support ORDER BY clause. You can either use the proprietary Sort provided by the conatainer(this makes it difficult to port) or sort the collection.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic