Reputation: 736
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
Reputation: 220842
There are 2 flags governing this behaviour:
Settings.returnIdentityOnUpdatableRecord
, default true
Settings.returnAllOnUpdatableRecord
, default false
You want to set the second flag to true as well.
Upvotes: 1