[英]how to get inserted/updated object after inserting/updating with jooq generated dao
I generated DictOrgDao from dict_org table in my postgres DB, using jooq code generation tool.我使用 jooq 代码生成工具从我的 postgres 数据库中的 dict_org 表生成了 DictOrgDao。 This dao has common methods like insert and update but they all return void.
这个 dao 有 insert 和 update 等常用方法,但它们都返回 void。 Is there any way to get inserted/updated object after inserting/updating with jooq generated dao?
在使用 jooq 生成的 dao 插入/更新后,有什么方法可以插入/更新 object 吗?
This should work out of the box if your POJOs are mutable.如果您的 POJO 是可变的,这应该开箱即用。 Here are the relevant flags in
Settings
:以下是
Settings
中的相关标志:
Settings.returnRecordToPojo
(default is true
): mutable POJOs should automatically be updated with generated keys. Settings.returnRecordToPojo
(默认为true
):可变 POJO 应使用生成的密钥自动更新。Settings.returnIdentityOnUpdatableRecord
(default is true
): generated identity values are returned on INSERT
Settings.returnIdentityOnUpdatableRecord
(默认为true
):生成的标识值在INSERT
上返回Settings.returnAllOnUpdatableRecord
(default is false
): generated default and trigger generated values are returned on INSERT
, UPDATE
, and MERGE
Settings.returnAllOnUpdatableRecord
(默认为false
):生成的默认值和触发器生成的值在INSERT
、 UPDATE
和MERGE
上返回
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.