Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the problem that the binding statement is not found in the framework integration Mybatis Plus

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces how to solve the problem that binding statements can not be found in the framework integration Mybatis Plus. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

1. When I introduced the jar package, I just didn't introduce the mybatis-plus-extension jar package to report invalid bound statement (not found) errors. For more information, please see the official document http://doc.ruoyi.vip/ruoyi/document/cjjc.html#%E9%9B%86%E6%88%90mybatis-plus%E5%AE%9E%E7%8E%B0mybatis%E5%A2%9E%E5%BC%BA.

Com.baomidou mybatis-plus-boot-starter 3.4.2 com.baomidou mybatis-plus-extension 3.4.2 com.baomidou mybatis-plus-core 3.4.2 com.baomidou mybatis-plus 3.4.2

two。 Need to replace the original MybatisConfig

Package com.ruoyi.framework.config;import com.baomidou.mybatisplus.annotation.DbType;import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;import com.baomidou.mybatisplus.extension.plugins.inner.BlockAttackInnerInterceptor;import com.baomidou.mybatisplus.extension.plugins.inner.OptimisticLockerInnerInterceptor;import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;import org.mybatis.spring.annotation.MapperScan;import org.springframework.context.annotation.Bean;import org.springframework.context.annotation.Configuration;import org.springframework.transaction.annotation.EnableTransactionManagement / * * MybatisPlus configuration * * @ author ruoyi * / @ EnableTransactionManagement (proxyTargetClass = true) @ Configuration@MapperScan ({"com.ruoyi.project.**.mapper", "com.ruoyi.business.**.mapper"}) public class MybatisPlusConfig {@ Bean public MybatisPlusInterceptor mybatisPlusInterceptor () {MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor (); / / paging plug-in interceptor.addInnerInterceptor (paginationInnerInterceptor ()); / / optimistic locking plug-in interceptor.addInnerInterceptor (optimisticLockerInnerInterceptor ()) / / blocking plug-in interceptor.addInnerInterceptor (blockAttackInnerInterceptor ()); return interceptor;} / * paging plug-in to automatically identify the database type https://baomidou.com/guide/interceptor-pagination.html * / public PaginationInnerInterceptor paginationInnerInterceptor () {PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor (); / / set the database type to mysql paginationInnerInterceptor.setDbType (DbType.MYSQL) / / set the maximum limit per page. Default is 500. there is no limit for-1 paginationInnerInterceptor.setMaxLimit (- 1L); return paginationInnerInterceptor;} / * * optimistic lock plug-in https://baomidou.com/guide/interceptor-optimistic-locker.html * / public OptimisticLockerInnerInterceptor optimisticLockerInnerInterceptor () {return new OptimisticLockerInnerInterceptor () } / * if it is a delete or update operation on the whole table, the operation https://baomidou.com/guide/interceptor-block-attack.html * / public BlockAttackInnerInterceptor blockAttackInnerInterceptor () {return new BlockAttackInnerInterceptor ();}} is shared here on how to solve the problem that the binding statement was not found in the framework integration Mybatis Plus. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report