Im trying to use criteria builder to get the difference between two dates in millisecond or smaller precision. I’m using H2, and for the life of me i cant do:
cb.function(“DATEDIFF”, BigInteger.class, cb.literal(“NANOSECOND”), …date1, date2)
However i get an error explaining that parameter 1 (the nanosecond literal) should be a temporal unit and not an object. Upon inspection, the nanosecond parameter is getting built in the sql surrounded with single quotes, when in sql it should be not surrounded by any quotes.
does anyone know how to implement this? i cant find any information online.
7