how to set cuurent DB time in jooq record object

Viewed 2405

I have generated jooq records via the code generator. In my record I have a timestamp field which I want to set as the DB current dat time.

The below works:

MyRecord myrecord = new MyRecord();
myrecord.setCreateTime(Timestamp.from(Instant.now())); 

But I want to use the DB time , so something like this:(obviously there is a compile error in the below syntax)

myrecord.set(MY_RECORD.CREATE_TIME, DSL.currentTimestamp());

What is the best way to achieve this?

2 Answers
Related