You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm seeing some weird issue while working with findAll() method with the specification and pageable arguments. If I set the lower page i.e. 0 size i.e. 10 then I don't have any issues. but if I set the page i.e. 0 and size to 30 I'm getting the duplicate records.
e.g.
ID
NAME
1
test
2
test
3
test
4
test
5
test
6
test
7
test
8
test
9
test
1
test
2
test
3
test
4
test
11
test
6
test
7
test
18
test
I have the following in the database.
ID
NAME
1
test
2
test
3
test
4
test
5
test
6
test
7
test
8
test
9
test
10
test
11
test
12
test
13
test
14
test
15
test
16
test
17
test
18
test
@Entity
@Table(name = "table_name")
@JsonIgnoreProperties(ignoreUnknown = true)
@DynamicUpdate
public class Emp implements Persistable<String> {
@Id
@Column(name = "emp_id", nullable = false, columnDefinition = "BINARY(16)")
public String empId;
@Column(name = "name");
public String name;
// other fields
//setters and getters
}
Thank you for the comment. Well, most probably the issue is caused by a missing explicit sort. Try to add sort by ID (I assume this is a primary key), since the "name" has duplicates. I hope this helps.
I'm seeing some weird issue while working with findAll() method with the specification and pageable arguments. If I set the lower page i.e. 0 size i.e. 10 then I don't have any issues. but if I set the page i.e. 0 and size to 30 I'm getting the duplicate records.
e.g.
I have the following in the database.
in the service class we are trying to fetch data using the following code:
http://localhost:8080/emp?name=test&page=0&size=10
http://localhost:8080/emp?name=test&page=0&size=20
Spring boot version : 2.2.2.RELEASE
The text was updated successfully, but these errors were encountered: