Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Ordering when lazy fetching in JPA  RSS feed

Mani Rai
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 {

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.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!