Which of the two methods are faster especially for over 1 million rows in database? And what is best practice, to use JPQL or Criteria?
Cheers
The best practice is to log the SQL statements created by Hibernate and analyse their execution plans for both methods. It's really hard saying which approach would produce more optimized SQL.
Criteria is a more clean way to do it, the output is the same, but as best practive I recommend Criteria.