Saturday, 5 September 2015

What is difference between sorted and ordered collection in hibernate?

This is one of the easy Hibernate interview question you ever face. A sorted collection is sorted in memory by using Java Comparator, while a ordered collection uses database's order by clause for ordering. For large data set it's better to use ordered collection to avoid any OutOfMemoryError in Java, by trying to sort them in memory.

No comments:

Post a Comment