Reputation: 2569
I have and interface StockRepository
extending PagingAndSortingRepository
.
Here I have a method Query method namely:
List<Stock> findByUserIdAndCustomerId(Integer userId, Integer customerId);
Joining Stock
I have StockBilling
on StockBilling.stock.id
and I want to modify my above method to order my results by StockBilling.balance due.
Any help in this regard is appreciated.
Upvotes: 0
Views: 661
Reputation: 2569
So I got this done by using following method name:
List<Stock> findByUserIdAndCustomerIdOrderByStockBillingId(Integer userId, Integer customerId);
Upvotes: 1