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 strings.

see jpa repositories table 2.3 more info.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -