Closed zhoulei4652 closed 3 years ago
this is my generatroConfig.xml
<!DOCTYPE generatorConfiguration PUBLIC
"-//mybatis.org//DTD MyBatis Generator Configuration 1.0//EN"
"http://mybatis.org/dtd/mybatis-generator-config_1_0.dtd">
<generatorConfiguration>
<context id="simple" targetRuntime="MyBatis3">
<jdbcConnection driverClass="com.mysql.jdbc.Driver" connectionURL="jdbc:mysql://localhost:3306/test" userId="root" password="123456" />
<javaModelGenerator targetPackage="com.xxx.domain" targetProject="src/main/java"/>
<sqlMapGenerator targetPackage="com/xxx/dao" targetProject="src/main/resources" />
<javaClientGenerator type="XMLMAPPER" targetPackage="com.xxx.dao" targetProject="src/main/java"/>
<table tableName="sys_user" />
</context>
</generatorConfiguration>
As you have seen, the "distinct" property is in the Example
class - not the Criteria
class.
Are you using any generator plugins? By default the generator creates selectByExample(XXXExample example)
methods, not selectByExample(XXXExample.Criteria example)
- this has been true for years.
you are right, the code was modified by other plugins.
thanks for your timely response and support.
SysUserMapper.java in dao layer one of generated method as below
when I invoke this method, it will throw below execption
I need to manully modify parameter from
SysUserExample.Criteria example
toSysUserExample example
and then, it will run properly.
my test code
mybatis: 3.4.5 mybaits-generator: 1.4.0