Hibernate - Difference between sorted and ordered collection

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

Sorted Collection :

- The sorted collection is a collection that is sorted using the Java collections framework. The sorting is done in the memory of JVM that is running hibernate, soon after reading the data from the database using Java Comparator

- The less the collection the more the efficient of sorting

Ordered Collection :

- The order collections will also sorts a collection by using the order by clause for the results fetched.

- The more the collection, the more efficient of sorting.

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

- A sorted collection is sorted 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.

- The efficiency depends on the size of the collection.

- Ordered collection is sorted by specifying the order-by clause for sorting this collection when retrieval.

- This is an efficient way to sort larger collections.
Hibernate - Difference between transient and detached objects
Difference between transient and detached objects - Transient objects do not have association with the databases and session objects...
Hibernate - Advantages and disadvantages of detached objects
Advantages and disadvantages of detached objects - Detached objects passing can be done across layers upto the presentation layer without using Data Transfer Objects. ...
Hibernate - What is Hibernate Query Language (HQL)?
What is Hibernate Query Language (HQL)? - Hibernate Query Language is designed for data management using Hibernate technology...
Post your comment