是否可以像这样在 pagerequest 中的 sortBy 中减去两个字段(数字)?
PageRequest.of(page, size, Sort.Direction.ASC, "price-discount")
. 这是我得到的错误..
排序表达式 'price-discount: ASC' 只能包含在 select 子句中使用的属性引用或别名。如果你真的想使用其他的东西进行排序,请使用 JpaSort.unsafe(...)!
是否可以像这样在 pagerequest 中的 sortBy 中减去两个字段(数字)?
PageRequest.of(page, size, Sort.Direction.ASC, "price-discount")
. 这是我得到的错误..
排序表达式 'price-discount: ASC' 只能包含在 select 子句中使用的属性引用或别名。如果你真的想使用其他的东西进行排序,请使用 JpaSort.unsafe(...)!