java - Spring data date between query -
i have query below:
select * products p ? between p.effctdate , p.expdate
can translate above query spring data jpa query method? example:
findbyproductid(productid)
or have use @query or named query handle such types of queries. tried searching here first before asking question spring data site did not find solution. appreciated.
you use following query:
date date = //input date list<product> = findbyeffctdateafterandexpdatebefore(date, date);
note have enter date
twice match both 'where' clauses. under assumption using date
objects, not literal string
s.
see jpa repositories table 2.3 more info.
Comments
Post a Comment