Hibernate (Java) Question:

Download Job Interview Questions and Answers PDF

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

Hibernate Interview Question
Hibernate Interview Question

Answer:

sorted collection vs. order collection
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.

order 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 .

Download Hibernate Interview Questions And Answers PDF

Previous QuestionNext Question
What is component mapping in Hibernate?How will you configure Hibernate?