Wasif Kirmani
Wasif Kirmani

Reputation: 1331

How to load records effectively in Hibernate

I have a database of one million records with 50 columns. I have an ORM model of Hibernate. The problem is that my page size is 200 rows. But, I want to fetch only 5 records. How can I achieve it without using a criteria API?

Upvotes: 0

Views: 156

Answers (1)

jambriz
jambriz

Reputation: 1303

Use the setMaxResults() method from the Query class.

Upvotes: 2

Related Questions