CopyPastor

Detecting plagiarism made easy.

Score: 0.8033297657966614; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2018-07-04
by Md. Sajedul Karim

Original Post

Original - Posted on 2018-07-04
by Md. Sajedul Karim



            
Present in both answers; Present only in the new answer; Present only in the old answer;

Here is a sample solution:
Query is :
@Query("SELECT * FROM user LIMIT :limit OFFSET :offset") User[] loadAllUsersByPage(int limit,int offset);
Here, it will list users based on limit and offset.
if `loadAllUsersByPage(2,0)` it will return the first 2 rows from the table.
if `loadAllUsersByPage(2,1)` it will return 2nd and 3rd rows from table.
but if `loadAllUsersByPage(-1,10)` then it will serve the first 10 rows from the table.
You can consider pagination to improve this problem.
**Query is** :
@Query("SELECT * FROM user LIMIT :limit OFFSET :offset") User[] loadAllUsersByPage(int limit,int offset);
Here, it will give a list of user based on limit and offset.
if `loadAllUsersByPage(2,0)` it will return first 2 rows from table.
if `loadAllUsersByPage(2,1)` it will return 3rd and 4th rows from table.
but if `loadAllUsersByPage(-1,10)` then it will serve first 10 rows from table.
Thanks :)

        
Present in both answers; Present only in the new answer; Present only in the old answer;