For the life of me, I cannot figure this out.
I want to select entities from my H2 database, and get the difference between an entities timestamp column and a passed parameter.
trying
var dateDiff = cb.function("DATEDIFF", BigInteger.class, cb.literal("NANOSECOND"), cb.parameter(OffsetDateTime.class, "startTime"), eventViewEnt.get(EventViewEntity_.timestamp));
causes the error (paraphrasing) ‘parameter 1 (the nanosecond literal) is supposed to be of type Temporal Unit, but got Object.
For the life of me i cannot figure out how to pass NANOSECOND into this function. Other possible solutions require i i pass a temporal unit also…
1