Xuan
Xuan

Reputation: 736

JOOQ doesn't return auto generated value for normal column

I have table user_profile, with 3 fields:

Below is my code to insert a new row to the table.

// dsl is DslContext, which is a bean, injected by Spring Boot
dsl.newRecord(Tables.USER_PROFILE).apply {
    name = "My Name"
    insert()
// UserProfile is an immutable pojo class, generated by jooq.
}.into(UserProfile::class.java)

In the code above, "id" field (primary key) is updated to the pojo, while "created" field (normal field) is "null".

What is the "best way" to include the returning value for "created" field?

Upvotes: 1

Views: 437

Answers (1)

Lukas Eder
Lukas Eder

Reputation: 220842

There are 2 flags governing this behaviour:

You want to set the second flag to true as well.

Upvotes: 1

Related Questions