What is the difference between sorted and orderd collection in hibernate?

Questions by sunils   answers by sunils

Showing Answers 1 - 3 of 3 Answers

Sanjay Ichalkaranje

  • Oct 25th, 2006
 

A sorted collection is sorted in-memory using java comparator, while order collection is ordered at the database level using order by clause.

For Sorted Collection:
A sorted collection is sorting a collection by utilizing the sorting features provided by the Java collections framework. The sorting occurs in the memory of JVM which running Hibernate, after the data being read from database using java comparator. 
   If your collection is not large, it will be more efficient way to sort it.


For Ordered Collection:
Order collection is sorting a collection by specifying the order-by clause for sorting this collection when retrieval. 
   If your collection is very large, it will be more efficient way to sort it . 

  • A component is an object saved as a value, not as a reference
  • A component can be saved directly without needing to declare interfaces or identifier properties
  • Required to define an empty constructor
  • Shared references not supported
  •   Was this answer useful?  Yes

    Give your answer:

    If you think the above answer is not correct, Please select a reason and add your answer below.

     

    Related Answered Questions

     

    Related Open Questions