In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article is about how to integrate TkMyBatis and PageHelper in Spring Boot. The editor thinks it is very practical, so I share it with you. I hope you can get something after reading this article.
1. Idea installs the code generator
2. Refer to the link above for offline installation.
3. Introduce the mapper-spring-boot-starter dependency into the pom.xm file, which automatically introduces the MyBaits dependency.
Tk.mybatis mapper-spring-boot-starter 2.1.5
4 、 application.yml
Mybatis: # path for storing entity classes type-aliases-package: cn.itchao.domain mapper-locations: classpath:mapper/*.xml
5. Create a common parent interface
The main function is to let the interface of the DAO layer inherit the interface in order to achieve the purpose of using tk.mybatis. Be careful not to let springboot scan the interface.
Package tk.mybatis.mapper;import tk.mybatis.mapper.common.Mapper;import tk.mybatis.mapper.common.MySqlMapper;/** * pay special attention to the fact that the interface cannot be scanned, otherwise there will be errors * / public interface MyMapper extends Mapper, MySqlMapper {}
6. Integrate paging plug-ins
Introducing pagehelper-spring-boot-starter dependencies into pom.xml files
Com.github.pagehelper pagehelper-spring-boot-starter 1.2.12 above is how to integrate TkMyBatis and PageHelper in Spring Boot. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un