Don't use Hibernate to upload your data. The bulk loader tools supplied with your database will do it much more efficiently.
Hibernate has its own pagination mechanism (see this). Be aware that if the database itself doesn't supply the mechanisms to implement this efficiently you will in effect be returnign the entire million records then filtering. Check your database documentation on pagination.