When using the paging plugin in Springboot project, I found that the PageHelper plugin was invalid
What I imported is:
Posted later
<dependency> <groupId></groupId> <artifactId>pagehelper</artifactId> <version>5.1.10</version> </dependency>
Now, if PageHelper is to be used in Springboot, it is necessary to inject:
@Configuration public class mybatisConfiguration { @Bean public PageHelperpageHelper(){ ("()"); PageHelper pageHelper =new PageHelper(); Properties properties =new Properties(); ("offsetAsPageNum","true"); ("rowBoundsWithCount","true"); ("reasonable","true"); (properties); return pageHelper; } }
Of course, it's OKUsing Springboot PageHelper LauncherNo injection required. Use out of the box. This method is recommended:
<dependency> <groupId></groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.10</version> </dependency>
PS: Issue that SpringBoot project and Spring project dependency on paging plugin Pagehelper does not work
Recently, it was developed simultaneously in the SpringBoot project and the Spring project. Both projects rely on the pagehelper paging plugin in the Mybatis framework, but the SpringBoot project paging does not work and has been querying all data.
Cause of error: Both projects introduce dependencies as
<dependency> <groupId></groupId> <artifactId>pagehelper</artifactId> <version>4.0.0</version> </dependency>
Solution: After multiple investigations and experiments, it was found that the paging plug-in that the SpringBoot project relies on was different from the Spring project, and the package under spring-boot-starter is required. Therefore, the SpringBoot project needs to configure the following dependencies:
<dependency> <groupId></groupId> <artifactId>pagehelper-spring-boot-starter</artifactId> <version>1.2.5</version> </dependency>
Summarize
This is the article about the invalid page plug-in PageHelper in SpringBoot project. This is all about this article. For more relevant invalid page plug-in PageHelper in SpringBoot, please search for my previous article or continue browsing the related articles below. I hope everyone will support me in the future!