mybatis-mapper / mapper

MyBatis Mapper
https://mapper.mybatis.io
Apache License 2.0
325 stars 47 forks source link

自定义主键 #90

Closed ChengSense closed 1 month ago

ChengSense commented 9 months ago

版本升级到2.1.1。自定定义主键报错,数据已经插入数据库。https://github.com/mybatis-mapper/mapper/issues/69 已经解决这个问题,能否给个样例如何配置谢谢

abel533 commented 9 months ago

别用 Mapper 接口(这个接口指定了 id),用BaseMapper,然后在实体中通过 userGenerxxxx = true 指定主键字段使用自增即可。