Mybatis-plus: Mybatis-Plus Comment

Created on 22 Feb 2018  ·  126Comments  ·  Source: baomidou/mybatis-plus

This is Mybatis-Plus discuss, Welcome your comments!

这里是 Mybatis-Plus 文档的讨论,欢迎留下你的足迹

Most helpful comment

自己在mapper(&xml)中加了方法 ,一直报错:Invalid bound statement (not found)。 这个是为啥

All 126 comments

Hello,Gitalk

Dyang 威武

可以的

baseMapper.selectOne(condition)在查询条件如果参数有枚举的情况下,有问题,代码如下:

 Student condition = new Student();
    condition.setOpStatus(opStatus);
  Student student = baseMapper.selectOne(condition);

如果这个opStatus是个枚举,我存数据库数据库的是枚举的name属性,上面的selectone 查询时用的ParameterMapping 获取不到对应的enumtypehandler ,导致查询参数对应不上;

mybatisplus-spring-mvc 项目 里的这一行

根本就无法切入事务

            TemplateConfig tc = new TemplateConfig();
            tc.setController("src/main/java/com/fendo/mybatisplus/templates/controller.java.vm");
            tc.setEntity("src/main/java/com/fendo/mybatisplus/templates/entity.java.vm");
            tc.setMapper("src/main/java/com/fendo/mybatisplus/templates/mapper.java.vm");
            tc.setXml("src/main/java/com/fendo/mybatisplus/templates/mapper.java.vm");
            tc.setService("src/main/java/com/fendo/mybatisplus/templates/service.java.vm");
            tc.setServiceImpl("src/main/java/com/fendo/mybatisplus/templates/serviceImpl.java.vm");

我把模板文件放到了src/main/java/com/fendo/mybatisplus/templates包下面了,并没有放到resources下,按以上配置,只生成了文件夹,并没有生成代码

            TemplateConfig tc = new TemplateConfig();
            tc.setController("/templates/controller.java.vm");
            tc.setEntity("/templates/entity.java.vm");
            tc.setMapper("/templates/mapper.java.vm");
            tc.setXml("/templates/mapper.java.vm");
            tc.setService("/templates/service.java.vm");
            tc.setServiceImpl("/templates/serviceImpl.java.vm");
            //如上任何一个模块如果设置 空 OR Null 将不生成该模块。
            mpg.setTemplate(tc);

           // 执行生成
           mpg.execute();

使用该配置,不生效,用的还是默认的模板。。。。项目template下的无效

@fendo8888 你可以试试放在别的目录,正常是有效的。

@qmdx
@fendo8888 你可以试试放在别的目录,正常是有效的。

解决了,在pom.xml中加入vm文件就行了:

<resources>  
    <resource>  
        <directory>src/main/resources</directory>  
        <includes>  
            <include>**/*.properties</include>  
            <include>**/*.xml</include>  
            <include>**/*.tld</include> 
            <include>**/*.dtd</include> 
            <include>**/*.ftl</include>  
            <include>**/*/*.jpg</include>  
            <include>**/*/*.png</include>
            <include>**/*/*.vm</include>
        </includes>  
        <filtering>false</filtering>  
    </resource>  
    <resource>  
        <directory>src/main/java</directory>  
        <includes>  
            <include>**/*.properties</include>  
            <include>**/*.xml</include>  
            <include>**/*.tld</include>  
            <include>**/*.dtd</include> 
            <include>**/*.vm</include> 
        </includes>  
        <filtering>false</filtering>  
    </resource>  
</resources>

以下两种方式都可以:

            TemplateConfig tc = new TemplateConfig();

// tc.setController("/templates/controller.java");
// tc.setEntity("/templates/entity.java");
// tc.setMapper("/templates/mapper.java");
// tc.setXml("/templates/mapper.java");
// tc.setService("/templates/service.java");
// tc.setServiceImpl("/templates/serviceImpl.java");
tc.setController("/src/main/java/com/fendo/mybatisplus/templates/controller.java");
tc.setEntity("/src/main/java/com/fendo/mybatisplus/templates/entity.java");
tc.setMapper("/src/main/java/com/fendo/mybatisplus/templates/mapper.java");
tc.setXml("/src/main/java/com/fendo/mybatisplus/templates/mapper.java");
tc.setService("/src/main/java/com/fendo/mybatisplus/templates/service.java");
tc.setServiceImpl("/src/main/java/com/fendo/mybatisplus/templates/serviceImpl.java");
//如上任何一个模块如果设置 空 OR Null 将不生成该模块。
mpg.setTemplate(tc);

           // 执行生成
           mpg.execute();

再次测试发现:
tc.setController("/src/main/java/com/fendo/mybatisplus/templates/controller.java");
tc.setEntity("/src/main/java/com/fendo/mybatisplus/templates/entity.java");
tc.setMapper("/src/main/java/com/fendo/mybatisplus/templates/mapper.java");
tc.setXml("/src/main/java/com/fendo/mybatisplus/templates/mapper.java");
tc.setService("/src/main/java/com/fendo/mybatisplus/templates/service.java");
tc.setServiceImpl("/src/main/java/com/fendo/mybatisplus/templates/serviceImpl.java");

这种方式不支持!!!!

代码生成是不是不支持H2数据库?我跑测试用例用的内嵌数据库,报异常 org.h2.jdbc.JdbcSQLException: Syntax error in SQL statement "SELECT [*]"; expected "TOP, LIMIT, DISTINCT, ALL, *, NOT, EXISTS, INTERSECTS"; SQL statement:
show table status [42001-196]

怎么取消多租户模式?

@softxiang
怎么取消多租户模式?

在配置分页插件不注入 sql 解析模块即可。

@liuxun123
mybatisplus-spring-mvc 项目 里的这一行

根本就无法切入事务

应该是可以的,不行你试试注解方式。

@qmdx

@liuxun123
mybatisplus-spring-mvc 项目 里的这一行

根本就无法切入事务

应该是可以的,不行你试试注解方式。

我已经解决了, 提供的码云上的样例项目里事务配置是不行的,我改成了 execution(* com.baomidou...service...*(..)) , 去切 jar 里面的方法。

这个评论功能居然 把一个* 星号吃了。。。

版本字段更新后不回写,如何配置版本再执行更新后,回写到更新对象上

我自定义了一个JsonTypeHandler,在调用mapper的updateById的时候,为什么没起作用?

我自定义了一个JsonTypeHandler,在调用mapper的updateById的时候,为什么没起作用?

Hello MyBatis-Plus

通过mybatis-plus生成的代码,实体类中有一个属性isDelete,然后通过mapper来insert数据,但是提示“deleted”,但是我这个对象里面的属性是 isDelete 是有正确提供getXXX,setXXXX等方法的,那么这个错误该如何解决?该不会强制要求必须都要改为delete属性吧??

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'delete' in 'class com.baomidou.springmvc.model.system.User'

@wuguofeng
我自定义了一个JsonTypeHandler,在调用mapper的updateById的时候,为什么没起作用?

通过 tableFiled el 属性注入,参考 源码测试用例部分

@weiailuxueqi
通过mybatis-plus生成的代码,实体类中有一个属性isDelete,然后通过mapper来insert数据,但是提示“deleted”,但是我这个对象里面的属性是 isDelete 是有正确提供getXXX,setXXXX等方法的,那么这个错误该如何解决?该不会强制要求必须都要改为delete属性吧??

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'delete' in 'class com.baomidou.springmvc.model.system.User'

不符合规范

@qmdx

@wuguofeng
我自定义了一个JsonTypeHandler,在调用mapper的updateById的时候,为什么没起作用?

通过 tableFiled el 属性注入,参考 源码测试用例部分

3q,问题解决了,不过感觉有点别扭,TableField里面的el,只设置属性名,另外增加一个typeHandler的配置项,或者增加一个@TypeHandler会不会好一点

springboot mybatis-plus 中怎么设置mybatis-config.xml 全局的配置文件的?

postgres jsonb 支持吗?

很好,很有用!

mybatis-plus-generator-2.1.8.jar
AutoGenerator mpg = new AutoGenerator();
// 选择 freemarker 引擎,默认 Veloctiy
// mpg.setTemplateEngine(new FreemarkerTemplateEngine());
FreemarkerTemplateEngine 类根本不存在,是还没实现吗,想要用freemarker应该怎么做?

springboot中启动出错
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'velocityConfigurer' defined in class path resource [org/springframework/boot/autoconfigure/velocity/VelocityAutoConfiguration$VelocityWebConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: org/apache/velocity/runtime/log/CommonsLogLogChute

配置是

com.baomidou
mybatisplus-spring-boot-starter
1.0.5


com.baomidou
mybatis-plus
2.1.9

必须要

org.apache.velocity
velocity
吗?
我看有的sb 项目中也没配置啊。
而且配置了velocity controller 请求都成了404

性能分析插件
@EnableTransactionManagement
@Configuration
@MapperScan("com.money.mapper")
public class MybatisPlusConfig {
/
*
* mybatis-plus SQL执行效率插件【生产环境可以关闭】
*/
@Bean
@Profile({"dev","test"})// 设置 dev test 环境开启
public PerformanceInterceptor performanceInterceptor() {
return new PerformanceInterceptor();
}
}
启动不会报错,但执行查询语句会报错,org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'statement' in 'class org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy'

@softxiang
怎么取消多租户模式?

完全取消可注释掉sqlParserList.add(tenantSqlParser);

你好,请问分页合理化怎么设置?前端传入页数大于总页数时。

@flylinran
你好,请问分页合理化怎么设置?前端传入页数大于总页数时。
http://mp.baomidou.com/#/page-plugin

这个分页好像不支持多列不同类型排序吧,比如A升序B降序

@weiailuxueqi 别好像你肯定啊!! 不要乱说

@qmdx
@weiailuxueqi 别好像你肯定啊!! 不要乱说

嗯,肯定

@Select({
"select a.id, a.name, a.description, a.status, a.create_time, a.update_time, a.online_time,",
"b.product_id, b.category, b.display_name, b.overview, b.developer, b.operator, b.need_contract, b.introduction, b.logo, b.strength",
" from dcoos_api_product a",
" left join dcoos_api_product_business b on a.id = b.product_id",
" where if(#{creatorId}>0, (a.creator_id = #{creatorId}), 1 = 1 )",
" and if(length(#{id}) > 0, locate(#{id}, a.id), 1=1) ",
" and if(length(#{name}) > 0, locate(#{name}, a.name), 1 = 1) ",
" and if(length(#{category}) > 0, locate(#{category}, b.category), 1 = 1) ",
" and if(#{beginDate} > 0 and #{endDate} > 0, a.update_time >= #{beginDate} and a.update_time < #{endDate}, 1 = 1) ",
" and if(length(#{status}) > 0, a.status = #{status}, 1 = 1) ",
})
@Results(value = {
@Result(column = "id", property = "id"),
@Result(column = "name", property = "name"),
@Result(column = "description", property = "description"),
@Result(column = "status", property = "status"),
// @Result(column = "creator_id", property = "creatorId"),
@Result(column = "create_time", property = "createTime"),
@Result(column = "update_time", property = "updateTime"),
@Result(column = "online_time", property = "onlineTime"),
@Result(column = "offline_time", property = "offlineTime"),

        @Result(column = "product_id", property = "businessInfo.productId"),
        @Result(column = "category", property = "businessInfo.category"),
        @Result(column = "display_name", property = "businessInfo.displayName"),
        @Result(column = "overview", property = "businessInfo.overview"),
        @Result(column = "developer", property = "businessInfo.developer"),
        @Result(column = "operator", property = "businessInfo.operator"),
        @Result(column = "need_contract", property = "businessInfo.needContract"),
        @Result(column = "introduction", property = "businessInfo.introduction"),
        @Result(column = "logo", property = "businessInfo.logo"),
        @Result(column = "strength", property = "businessInfo.strength"),


        @Result(column = "id", property = "apiUsages", many = @Many(select = "getApiUsages")),
        //@Result(column = "id", property = "businessInfo", one = @One(select = "com.chinatelecom.dcoos.api.mgt.api.mapper.product.ApiProductBusinessMapper.getProductBusiness")),
})
List<ApiProductVO> getProducts(ApiProductQueryRequest queryRequest);

这种sql

Pagination p = new Pagination(pageNum, pageSize).setOrderByField(orderColumn).setAsc(true);
PageHelper.setPagination(p);

        List<ApiProductVO> list = productMapper.getProducts(queryRequest);

        PageInfo<ApiProductVO> result = null;//PageInfo.transferFor((Page) list);

        int total = PageHelper.freeTotal();

        pageInfo.setRecords(list);
        pageInfo.setTotal(total);
        pageInfo.setSize(pageSize);
        pageInfo.setCurrent(pageNum);

会导致在2个sql中加上分页,统计的total也有问题

nice

有个疑问,自动生成的代码与阿里巴巴java开发规范里面的是保持一致的吗

如果说在mybatis mapper里面
<if test="a==1"></if>
想把此段1换成枚举怎么做, 如
<if test="a==枚举值"></if>
如何更优雅的解决此类问题呢,

java.lang.AbstractMethodError: org.apache.velocity.runtime.resource.loader.ResourceLoader.init(Lorg/apache/velocity/util/ExtProperties

Caused by: java.lang.ClassNotFoundException: org.apache.velocity.runtime.log.CommonsLogLogChute

springboot 启动报错,pom是

com.baomidou
mybatisplus-spring-boot-starter
1.0.5


com.baomidou
mybatis-plus
2.1.9

有人和我一样的问题吗

hi,user表做分表处理,比如 user_01,user_02,user_03.....,这样的情况 mp支持么?mapper接口、pojo 可以设置一个么?

分页溢出设置无效overflowCurrent,凑合着用https://pagehelper.github.io了。建议完善文档

请问一下如何配置到springboot上?乐观锁插件

使用@tableName标签后,数据库部分字段,不想跟实体类做映射,有办法处理吗,实体类没有数据库字段的变量,启动就已经报错了。

相关 SQL 解析如多租户可通过 @SqlParser(filter=true) 排除 SQL 解析,注意!!全局配置 sqlParserCache 设置为 true 才生效。经过测试官方demo发现,设置成false才生效

@TableField(value="is_list")
private Boolean isList;

这样写,最后的condition就变成 list!=null , 然后在ibatis执行的时候invoke getList 就错误了
我写成:

@TableField(value="is_list",strategy=FieldStrategy.IGNORED)
private Boolean isList;

就没有问题了,你看是哪里出了问题

mybatis-plus 插入数据时,如何返回主键?求大神帮忙,没有自动回写到实体类中

java.lang.NoSuchMethodError: com.baomidou.mybatisplus.plugins.pagination.Pagination.setTotal(I)Lcom/baomidou/mybatisplus/plugins/pagination/Pagination; 这个是怎么回事呀,找了N久

EntityWrapper ew=new EntityWrapper<>();
ew.eq("name",name);
// ew.setSqlSelect("initial_price");
Classify classify=classifyService.selectOne(ew);

根据名字查询 如果名字是汉字 加上ew.setSqlSelect("initial_price"); 查询单子字段 查询结果为null 去掉可以 可能是个bug

user.setId(1);
EntityWrapper wrapper = new EntityWrapper<>(user);
selectPage(Page page, Wrapper wrapper);
没有正确拼接,sql中不会拼接where id = 1,查询条件失效

发现一个小错误:application.yml
如果是放在src/main/java目录下 classpath:/com/yourpackage//mapper/Mapper.xml
改成:
classpath:/com/yourpackage/*/mapper/Mapper.xml

多级的目录应该是"**"两个星号。

请问分页想要返回List 怎么写

Spring Boot都在去除xml,希望支持properties配置方法

填充字段支持查询填充字段么,假如我需要将一个pojo中的属性在查询操作后赋值的时候,这个字段只是一个dto不存在数据库中,这种问题是其他的办法去解决么

找不到mapper接口下的方法,application中已经配置MapperScan了

问个问题:mapper-locations配置了,但是无法读取jar中的mapper.xml文件,请问该怎么处理?

将mysql中的tinyint(1)类型自动生成Boolean类,应该如何配置?

globalConfiguration.setDbColumnUnderline(true) 当设置这个时,java类里面的field属性名不起作用,默认解析成下划线,这个建议优先field里面的value值

@a931083335 目前是优先使用注解的

@gltolx 看下文档问题部分

没提供批量插入接口

@hhxyjsj 在 serviceImpl 中,至于为什么要放这里看文档问题部分

生成的kotlin文件package和import代码后面有; 能不能去掉呢,多谢啦

可不可以在生成 SQL 时自动为 column 参数添加反引号,如下代码的 key 就需要手动添加反引号,否则 SQL 语法错误(虽然在设计数据库的时候不要使用关键字才是最好的办法)。

{.java} @Override public Properties selectByKey(String prefix, String key) { return selectOne(Condition.create() .eq("prefix", prefix) .eq("`key`", key)); }

mybatis-plus-2.19不支持批量保存?一下是错误:
com.baomidou.mybatisplus.exceptions.MybatisPlusException: Error: Cannot execute insertBatch Method. Cause

page.setRecords是无返回值的,文档中怎么return的?

mybatis-plus支持存储过程吗

例如:user对象中包含role对象
原来mybatis 中使用resultMap给role.id赋值, 在mp中还是只能使用这种方式吗

能不能实体注解独立出来,我们的bean不想依赖mybatis-plus,需要纯净的java bean

@Kelin92
能不能实体注解独立出来,我们的bean不想依赖mybatis-plus,需要纯净的java bean

有哦查看 MP 的包结构

请问下为什么自定义sql用了分页插件,如果使用orderby分页就有问题,不使用orderby就没问题,是配置的问题还是?

联合主键怎么搞?

请问联合主键怎么搞?
我注意到文档中有不支持的描述,但是有什么办法弥补吗?不然只能放弃了

目前还不支持增删改查自动生产代码 吗

目前看,这个框架各种不成熟,企业应用不建议使用

spring aop 拦截不到mapper方法

@cuivip 建议不管表中 id 是否有实际意义每张表都有自己的独立 id

为什么spring boot方式注入了mybatis分页插件会影响到原本的其他功能queryPage()方法呢??

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 0,10' at line 1

@qinxiang01 分页插件默认处理 rowbound 参数的 statementId 对应的 sql 然后自动加上分页 limit

@qmdx
你好,现在我两种场景都需要支持,按照上面的文档自定义的sql分页是OK的,但是会造成框架定义的queryPage方法多了一个limit字段,这个应该怎么解决啊?

自己在mapper(&xml)中加了方法 ,一直报错:Invalid bound statement (not found)。 这个是为啥

@TableField(condition = SqlCondition.LIKE),怎么用啊?我加了后,这个用法没起作用selectPage(new Query<>(params), new EntityWrapper<>());

good

这东西 BUG还是不少啊,加了@tablefield(condition = SqlCondition.LIKE)居然没变化

还好吧,不要把这个框架当成hibernate功能用,没那么智能发自我的华为手机-------- 原始邮件 --------主题:Re: [baomidou/mybatis-plus] Mybatis-Plus Comment (#248)发件人:aishangdren 收件人:baomidou/mybatis-plus 抄送:zengdegui 845875725@qq.com,Comment 这东西 BUG还是不少啊,加了@tablefield(condition = SqlCondition.LIKE)居然没变化

—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.

{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/baomidou/mybatis-plus","title":"baomidou/mybatis-plus","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/baomidou/mybatis-plus"}},"updates":{"snippets":[{"icon":"PERSON","message":"@aishangdren in #248: 这东西 BUG还是不少啊,加了@tablefield(condition = SqlCondition.LIKE)居然没变化"}],"action":{"name":"View Issue","url":"https://github.com/baomidou/mybatis-plus/issues/248#issuecomment-385301746"}}}

@aishangdren
这东西 BUG还是不少啊,加了@tablefield(condition = SqlCondition.LIKE)居然没变化

该注解只对 EntityWrapper 传入实体的时候产生 like 效果

生成的entity类中不能使用引用类型的属性是吗?

点赞,点赞,点赞

期待持续改进,持续增强,加油

怎么在同一个mapper中支持多种数据库,如何配置 databaseId

   <select id="isExist" resultType="Boolean" databaseId="mysql">
        SELECT EXISTS(SELECT 1 FROM `${db}`.test_table WHERE table_id=#{tableId} LIMIT 1)
    </select>

    <select id="isExist" resultType="Boolean" databaseId="oracle">
        SELECT COUNT(*) FROM ${db}."test_table " WHERE "table_id"=#{tableId}
    </select>

发现个问题,使用sharding-jdbc读写分离,分页查询始终到主库中查询,其它全表等查询都可以到从库查,是配置问题吗

@qmdx
@likeswinds @hanjunchen
https://github.com/baomidou/dynamic-datasource-spring-boot-starter

extends AbstractRoutingDataSource这种方式可以实现,但是我现在用的是sharding-jdbc的方式,出现分页查询不到slave中查的问题

登陆上来就为了点赞。大力支持

搞定了,分页插件中设置下方言类型就正常了

ServletRequestAttributes attributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();在异步线程里面 RequestContextHolder.getRequestAttributes()为null

请求示例:xx.selectPage(new Page(1,limit),entityWrapper);

反手就是一个赞

多表连接查询分页,插件能完成吗?还是说需要自己写sql,或者生成视图

@a1540770111
写你自己的连接查询的sql就行,分页插件会自动给你套一层视图以及查询总条数这些的。
还需要你写视图,那要分页插件干嘛。

@uhzgnaw
@a1540770111
写你自己的连接查询的sql就行,分页插件会自动给你套一层视图以及查询总条数这些的。
还需要你写视图,那要分页插件干嘛。

懂了 谢谢大神

多表连接查询,如何通过MP实现,有大佬简单说明下或给个简单示例吗?

为什么用CachePaginationInterceptor,分页没有缓存效果?

这种noxml的形式好像是对于单表吧多表关联也支持么?

@liuyangdxxd
这种noxml的形式好像是对于单表吧多表关联也支持么?

多表 xml

使用activerecord模式curd时报这个错是为什么?
java.lang.NullPointerException
at com.baomidou.mybatisplus.toolkit.GlobalConfigUtils.currentSessionFactory(GlobalConfigUtils.java:60)
at com.baomidou.mybatisplus.mapper.SqlHelper.sqlSession(SqlHelper.java:104)
at com.baomidou.mybatisplus.mapper.SqlHelper.sqlSession(SqlHelper.java:58)
at com.baomidou.mybatisplus.activerecord.Model.sqlSession(Model.java:373)
at com.baomidou.mybatisplus.activerecord.Model.updateById(Model.java:157)
定位到TableInfoHelper.getTableInfo()方法了,但是不知道为什么。有人能解释下吗?

spring boot与mybatis集成必须的有那个myconfig类么,那个类的注释上mapper*是什么意思

版本 2.1.9 生成MSSQL 的语句 SELECT id,pid,pid_path,name,p_cnname_path,ifyx FROM ,我不需要在Name 列前后添加 标识怎么处理

2.3版本不提供jar了吗?

老铁 今天我对代码做了混淆后出现了这个问题,大佬能否指点一下。

2018-05-18 16:53:23:025 [main] DEBUG o.s.b.diagnostics.LoggingFailureAnalysisReporter - Application failed to start due to an exception
org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'com.baomidou.mybatisplus.mapper.BaseMapper' available: expected single matching bean but found 9: exceptionFileMapper,machineClusterMapper,userClusterMapper,taskDataSnapshotMapper,machineMapper,clusterMapper,taskMapper,taskDataMapper,sysLogMapper
at org.springframework.beans.factory.config.DependencyDescriptor.resolveNotUnique(DependencyDescriptor.java:173)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1116)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:208)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1138)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1066)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:585)
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:88)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:366)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1264)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:553)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:483)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:197)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:761)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:867)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:543)
at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:122)
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:693)
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:360)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:303)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.perf.xlion.start.PerfmaStarter.a(PerfmaStarter.java:15)
at com.perf.xlion.WMain.main(WMain.java:7)

插件超级好用,感谢感谢

自定义模板应该这样设置 tc.setEntity("/templates/entity.java");

开源世界里的精神支撑

配置了,还是不能热加载是什么原因啊

你好 ,请问一下Long类型主键非自增无法insert是为什么,提示主键没有默认值。 sql语句中未设置主键值

666

你好,在TenantHandler内如果想查询一个表信息来返回tenant column 和判断是否需要执行filter怎么做啊?我尝试了在里面装配一个Service或者Mapper都会报错。

这个如何走关联?关联还得走原始mybatis吗?

代码生成 模板引擎那块

org.apache.velocity
velocity
${velocity.version}

2.在对应的mapper.xml中将原有注释修改为链接式声明,以保证xml文件里的缓存能够正常, 这个是什么意思啊,有没有具体的示例

您好,请问集成了mybatis-ehcache, 在MP这边应该怎么处理?

截稿

Was this page helpful?
0 / 5 - 0 ratings