TomEE 7.0.3 (OpenJPA 2.4.2)
I am trying to write the following statement using CriteriaBuilder:
select t0.* from my_table as t0 where date(now()) between date_sub(t0.customdate, INTERVAL t0.reminder DAY) and t0.customdate
I thought it might look something like this:
CriteriaBuilder cb = em.getCriteriaBuilder();
cb.between(new Date(), cb.function("date_sub", Date.class, myTable.get(MyTable_.customdate), myTable.get(MyTable_.customdate)), myTable.get(MyTable_.customdate))
But I can't work out how to finish it

Reply via email to