Search code examples
kotlinjooq

Jooq - Insert does not update object with generated id


I'm inserting using DSL context:

val userRecord = create.newRecord(ITR_NE_USER, user)
val x = create.executeInsert(userRecord)

I would expect userRecord to be updated with the generated ID (this is Kotlin) - it's still null after the insert.

How do I make it give me the value back?


Solution

  • Just call

    userRecord.insert();