Reputation: 181
I have a custom @Query in a repository:
@Query(value = "select CURRENT_DATE - INTERVAL '?1 days'", nativeQuery = true)
public List<OrderEntity> getOrders(Integer numDays);
I want to add param in '?1 days' for example
getOrders(5) -> select CURRENT_DATE - INTERVAL '5 days'
But it doesn't work, not filter.
How can I write this query so that it works with JPA?
Upvotes: 1
Views: 288