java - Hibernate Skip and take some rows -


how let's 20-35 rows fromt eh table?

how can select in hibernate?

something that:

mytable.skip(20).take(15); 

thanks.

a combination between query#setfirstresult(int i) , query#setmaxresults(int i) skip first 20 records , fetch next 15 (as shown in example) :

list<table> page3 = session.createquery(       "from table")       .setfirstresult(20)       .setmaxresults(15).list(); 

Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -