Comments (2)
这个不属于插件的支持范围,请参照官方 generatedKey,你使用的MySQL且是自增主键,应该配置
<generatedKey identity="true" sqlStatement="MySql" column="fid"/>
from mybatis-generator-plugin.
多谢 何大大 @itfsw 的回复,之前使用你的插件 1.1.x 版本时。直接在 Mapper XML 文件里指明 useGeneratedKey=true keyPropertry=fid
,插入数据是可以返回主键的。
现在直接在生成 XML 的配置文件里配置:
<table>
<generatedKey column="fid" sqlStatement="MySql" identity="true"/>
</table>
也达到同样的效果,不必侵入式更改 Mapper 文件 🎉
from mybatis-generator-plugin.
Related Issues (20)
- 逻辑删除支持设置id
- Upsert配合useGeneratedKeys使用触发ibatis异常 HOT 1
- 什么时候可以升级mybatis-generator-core到1.4.0啊,非常期待 HOT 3
- The alias 'Column' is already mapped to the value 'com.aaa.bbb.dao.entity.Ccc$Column' HOT 1
- OptimisticLockerPlugin does not support tables that have multiple primary keys
- LombokPlugin conflicts with MyBatis3Simple
- 能否开发支持JSON的插件,比如JSON_SET, JSON_ARRAY_APPEND之类的?
- Not working via try to eclipse plugin HOT 1
- 支持多表联合查询吗
- 使用Java API方式生成代码,报“获取插件列表失败!”
- UpsertPlugin生成的upsert开头的方法sql语义不正确
- 希望增加BaseMapper,BaseEntity 这种继承
- 数据库中decimal类型的字段会被生成为Long类型的java类字段 HOT 1
- select返回的结果会自动去掉前后空格?
- A required class was missing while executing org.mybatis.generator:mybatis-generator-maven-plugin:1.4.1:generate: org/mybatis/generator/api/dom/xml/Element HOT 7
- 请问批量插入开启allowMultiQueries后是否保证原子性
- 我使用rootClass属性设置继承父类,然后也是用了插件的builder,但是结果导致,生产的builder也继承了父类,有没有解决办法
- 批量插入batchInsertSelective无法返回id
- 能否增加空行插件
- com.itfsw.mybatis.generator.plugins.CommentPlugin 插件不管用 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mybatis-generator-plugin.