MyBatis的:如何给Postgres下返回插入对象的ID?

编程入门 行业动态 更新时间:2024-10-27 00:34:10
本文介绍了MyBatis的:如何给Postgres下返回插入对象的ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经得到了其中ID定义为 BIGSERIAL A Postgres的表。怎么样我可以使用 @Insert 并取回插入实体的ID?我是期待映射器的方法要么返回ID或填充ID实体对象内场。任何想法?

I've got a postgres table where the ID is defined as bigserial. How can I use @Insert and get back the id of the inserted entity? I am expecting the mapper method to either return the id or populate the id field inside the entity object. Any ideas?

推荐答案

NVM,我想我找到了答案其他线程上,mybatis-user.963551.n3.nabble/How-to-return-the-ID-of-the-inserted-object-under-Postgres-td1926959.html

NVM, i think i found the answer on the other thread, mybatis-user.963551.n3.nabble/How-to-return-the-ID-of-the-inserted-object-under-Postgres-td1926959.html

有是谁在这里登陆的链接,其他任何人。

There's the link for anyone else who lands here.

更多推荐

MyBatis的:如何给Postgres下返回插入对象的ID?

本文发布于:2023-10-18 12:07:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1504186.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对象   MyBatis   Postgres   ID

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!