I am working on a jpa query which requires to fetch all the records whose last updated time is more than 15 minutes My query goes like
Select * from user u where u.last_modified >= NOW() - INTERVAL '5 minutes'
I will be passing the minutes dynamically ie in my jpa
@Query("Select * from user u where u.last_modified >= NOW() - INTERVAL ':timeInMinutes minutes'")
getRecord(String timeInMinutes);
This does not work. I want to pass the minute dynamically. Can someone please help me with this