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

Gil*_*ili 5 annotations ibatis mybatis

我有一个postgres表,其中ID定义为bigserial。如何使用@Insert和获取插入实体的ID?我期望mapper方法返回ID或填充实体对象内的ID字段。有任何想法吗?

小智 3

NVM,我想我在另一个线程上找到了答案, http://mybatis-user.963551.n3.nabble.com/How-to-return-the-ID-of-the-inserted-object-under-Postgres -td1926959.html

对于其他登陆这里的人来说,有一个链接。