PagingAndSortingRepository 中的 Order By 子句
Order By clause in PagingAndSortingRepository
我有接口 StockRepository
扩展 PagingAndSortingRepository
。
这里我有一个方法查询方法即:
List<Stock> findByUserIdAndCustomerId(Integer userId, Integer customerId);
加入 Stock
我在 StockBilling.stock.id
上有 StockBilling
,我想修改我的上述方法以在 StockBilling.balance 到期之前对我的结果进行排序。
在这方面的任何帮助表示赞赏。
所以我使用以下方法名称完成了此操作:
List<Stock> findByUserIdAndCustomerIdOrderByStockBillingId(Integer userId, Integer customerId);
我有接口 StockRepository
扩展 PagingAndSortingRepository
。
这里我有一个方法查询方法即:
List<Stock> findByUserIdAndCustomerId(Integer userId, Integer customerId);
加入 Stock
我在 StockBilling.stock.id
上有 StockBilling
,我想修改我的上述方法以在 StockBilling.balance 到期之前对我的结果进行排序。
在这方面的任何帮助表示赞赏。
所以我使用以下方法名称完成了此操作:
List<Stock> findByUserIdAndCustomerIdOrderByStockBillingId(Integer userId, Integer customerId);