Hi,
I have to sum to a date of minutes, and check the date obtained is greater than the current date.
My idea is as follows:
Calendar currentTime = Calendar.getInstance(); Date currenteDate = currentTime.getTime(); Expression<Date> dateCapture = root.get(Counter_.dateCapture); Expression<Integer> samplingPeriod = root.get(Counter_.samplingPeriod); Expression<Integer> delayMinutes = cb.prod(samplingPeriod,3); //minutes to be added
I must now sum to the dateCapture the delayMinute
and verify that the current date is less than dateCapure+delayMinutes,
cb.greaterThan(dateCapture+delayminutes, currenteDate);
How to do!!