Suppose I have following rows in a table “mytable”
id
1
2
3
…
…
500
and my query is like select m from mytable m where m.id < 300
how can I get following output in the same order?
201
202
…
…
…
299
I am using setMaxResult(100) but it returns me output like this
1
2
…
…
100
any advice?
You can use
setFirstResultto define the start index. Together withsetMaxResultyou can get a specific range.