About subtraction

manual

Numbers in JPQL and Criteria Queries

Shows how numbers, arithmetic expressions and numeric functions and operators (MOD, ABS) can be used in JPQL queries.... 4 binary operators:   + (addition), - (subtraction), * (multiplication) and / (division). ... ) ; // number + expression   // Subtraction (-) Expression javax.persistence.criteria.Expression ...

 
forum_thread

How to add minutes to a Date with JPA2

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 #1 2012-06-22 09:31 Hi,  I have to sum to a date of minutes, and check the date obtained is greater than the current dat ...

 
manual

JPA Query Expressions (JPQL / Criteria)

Describes JPA query (JPQL / Criteria API) expressions (literals, operators and functions).... / (division), + (addition) and - (subtraction). Comparison operators : =, <>, <, ...