Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ordering when lazy fetching in JPA

 
Mani Rai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,

I am using JPA implemented by Hibernate and I have been wondering if there's any provision of ordering list when lazy loading the child objects. For example:

class Order {

@OneToMany
List<Items> itemList;

}

The above order class have one to many relation with item class. When I fetch order, I can also fetch list of items lazily. But I was wondering about provision of some annotations/attributes by hibernate so that item list will be listed in ascending/descending order.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic