1,報錯信息:com.github.pagehelper.PageException:無法自動獲取數據庫類型,請通過helperDialect參數指定!
1>.使用Mybatis設置如下:
<plugins>
<!-- com.github.pagehelper為PageHelper類所在包名 -->
<plugin interceptor="com.github.pagehelper.PageInterceptor">
<property name="helperDialect" value="postgresql" />
</plugin>
</plugins>
2>.springboot整合mybatis使用如下:
在pom文件中引入Pagehelper分頁插件:
<!-- 分頁插件 -->
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
</dependency>
配置分頁插件,打開application.properties,添加如下配置信息:pagehelper.helper-dialect=postgresql
