I have a situation where I need to extract purchase records based on User's Cards (number of cards would vary from user to user) using JPA.
The equivalent SQL query would be something like:
select * FROM Purchase WHERE cardId=10 OR cardId=1 OR.... ORDER BY purchasedate desc;
My DAO method signature is:
public List<Purchase> getPurchases(List<Card> cardsList)
I believe that I will have to use criteria query but I'm not quite sure how to implement it.