Ok, I came up with this code but not sure if this is the best way?

PersonRecord personRecord = dsl.newRecord(Tables.PERSON, person);
if (person.getId() != null) {
    personRecord.changed(Tables.PERSON.ID, false);
    personRecord.changed(Tables.PERSON.VERSION, false);
}
personRecord.store();



On Monday, March 26, 2018 at 11:46:58 AM UTC+2, BTJ wrote:
>
> I am back to JOOQ after I used JOOQ for as project some years ago but 
> there is one thing that is not clear to me.
> When fetching a POJO and updating this object, what is the best way to 
> update the record in the database?
> I see I have been using the dsl.executeUpdate method but I am trying to 
> use ExecuteWithOptimisticLocking and I loose this feature when using this 
> method.
> So how should I move from POJO to records to use the store method? Or is 
> it another way to do this?
>
> Also, a bit on the sideline. If I need more functionality in my POJOs, 
> what's the best way to "generate" POJOs? Just copy the field names from the 
> record object and create my own POJOs or?
>
>
> Regards,
>
> BTJ
>

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to