Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/316.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 可分页属性大小值不生效_Java_Search_Pagination_Request - Fatal编程技术网

Java 可分页属性大小值不生效

Java 可分页属性大小值不生效,java,search,pagination,request,Java,Search,Pagination,Request,我有一个端点,在其他属性中,它需要一个可分页的 众所周知,pageable有三个属性(页面、大小、排序) 虽然前两个属性工作正常,我可以通过更改它们的值来操作返回的结果列表,但sort属性没有任何效果 这是我的疑问: http://localhost:8080/api/social/msg/?socialRef=general&fromDate=2020-07-29T22:00:00.000Z&toDate=2020-08-10T14:42:13.325Z&page=0&

我有一个端点,在其他属性中,它需要一个可分页的

众所周知,pageable有三个属性(页面、大小、排序)

虽然前两个属性工作正常,我可以通过更改它们的值来操作返回的结果列表,但sort属性没有任何效果

这是我的疑问:

http://localhost:8080/api/social/msg/?socialRef=general&fromDate=2020-07-29T22:00:00.000Z&toDate=2020-08-10T14:42:13.325Z&page=0&size=1000&sort=createdAt,desc
和端点代码:

public PaginatedCollection<SocialMsg> CustomCollectionListAll(Pageable pageable, Date lastModifiedBefore, Date lastModifiedAfter, String socialRef)
    return socialService.messages().listAll(toPageableVO(pageable), lastModifiedBefore, lastModifiedAfter, socialRef);
public PaginatedCollection CustomCollectionListAll(可分页、日期lastModifiedBefore、日期lastModifiedBefore、字符串socialRef)
return socialService.messages().listAll(toPageableVO(pageable),lastModifiedBefore,lastModifiedAfter,socialRef);

确保
createdAt
是Jpa使用的类的一个字段,并且它的类型实现了Compariable