How To Getlist Using Jpa When The First Entity Is The Following Entity After The Entity With Specified Primary Key
To getList form offset with limit I can use: @Override public List getList(int offset, int limit) { String SELECT_COLLECTIONS = 'select collec
Solution 1:
This won't work. For current data you could select entities together with rank(), find the value of rank() for specified id and then use it to query the following data (this function is vendor specific, available for example in postgres, sql server). But you're not using order by, what makes the result ordering not defined. After you save some data in your database, the ordering could change and the result won't be the same.
If there is a possibility you can use id, then you can write something like this:
"select collection from " + Collection.class.getName() + " collection where collection.id > :id order by collection.id";
And the pass a parameter id.
Post a Comment for "How To Getlist Using Jpa When The First Entity Is The Following Entity After The Entity With Specified Primary Key"