⚙️ config(common): pagehelper多数据源自动识别对应方言的分页

1.yaml里的配置是pagehelper-spring-boot-starter
  的,对pagehelper来说没用
2.使用配置类PagehelperConfig

(cherry picked from commit 2303b18a78679a3211f1caf620eb2adbdfd3cedc)
(cherry picked from commit f066ec91bc93f5a81aa7f826d227fb1b4d3fed04)
This commit is contained in:
GeHui 2024-05-15 13:59:45 +08:00
parent da91600948
commit 2635d74af5

View File

@ -4,6 +4,8 @@ import com.github.pagehelper.PageInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Properties;
/**
* Pagehelper分页兼用老项目
*
@ -14,6 +16,11 @@ public class PagehelperConfig {
@Bean
public PageInterceptor pageInterceptor(){
PageInterceptor pageInterceptor = new PageInterceptor();
Properties properties = new Properties();
properties.setProperty("supportMethodsArguments","true");
properties.setProperty("autoRuntimeDialect","true");
pageInterceptor.setProperties(properties);
return pageInterceptor;
}
}