Comments (4)
您好,已经看到您的提交,这里返回统一都使用的resultType来做的参数绑定,请问会出什么问题吗?
使用resultType来做是因为如果在代码生成时如果采用resultMap当代码生成开启
<property name="constructorBased" value="true"/>
最终会因为构造函数参数个数不对应产生错误,所以当时考虑使用resultType来做属性绑定。
如果您使用中有什么异常,能具体描述一下吗?
from mybatis-generator-plugin.
<result column="redundant_school_region" jdbcType="VARCHAR" property="schoolRegion"/>
需要数据库字段名称跟resultType的model字段是,不用resultMap的话无法关联
from mybatis-generator-plugin.
了解,那这里可能要单独再生成一个属性绑定的resultMap而不能使用原生那个,不然在启用constructorBased会出异常,我尽快修正。谢谢您的反馈!
from mybatis-generator-plugin.
已修复这个bug,请使用最新版本
<dependency>
<groupId>com.itfsw</groupId>
<artifactId>mybatis-generator-plugin</artifactId>
<version>1.1.1</version>
</dependency>
UPDATE:
- bugfix(issues#16):SelectSelectivePlugin插件返回类型之前是使用resultType进行返回(规避在启用constructorBased时因为参数个数不同导致的异常),但是在用户使用自定义column时会出现属性不对应的BUG,所以修复成使用resultMap进行属性绑定;
- PS:如果没有自定义column之前版本不影响正常使用,而且改为使用resultMap进行属性绑定时,当某一行所有数据都为null时会存在list中存在空元素情况,使用时一定要注意进行null判断(这个是Mybatis自身机制不是插件异常,Mybatis对于不存在值的行不会生成对象,当然如果有更好的处理办法欢迎大家提出来)!
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.