This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Hibernate mapping sort / order-by? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate mapping sort / order-by?" Watch "Hibernate mapping sort / order-by?" New topic
Author

Hibernate mapping sort / order-by?

Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74
What should I use (sort or order-by) if I need to fetch a Set(one-to-many mapping)? How is sort different from order-by?

Thanks,
Vijay
pascal betz
Ranch Hand

Joined: Jun 19, 2001
Posts: 547
from hibernate doc:

sort="unsorted|natural|comparatorClass"
order-by="column_name asc|desc"


order by is SQL order by, performed in DB
sort is in memory sorting based on natural order or trough a comparator class.

pascal
Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74
Oops...

Why didn't it strike my mind before

Thxs Pascal
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Hibernate mapping sort / order-by?
 
Similar Threads
order of filter mapping
Mapping a qualified association with Hibernate
DataStructure help
why arrayLIst does not sort the elements i add
Sorting