Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
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 The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate mapping sort / order-by?" Watch "Hibernate mapping sort / order-by?" New topic

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?

pascal betz
Ranch Hand

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

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.

Vijay Kashyap
Ranch Hand

Joined: Jul 30, 2001
Posts: 74

Why didn't it strike my mind before

Thxs Pascal
I agree. Here's the link:
subject: Hibernate mapping sort / order-by?