求助:java.util.ArrayList cannot be cast to com.github.pagehelper.Page
在同一个工程下
最开始用com.github.pagehelper插件进行数据分页没有配置spring导致类型转换不了,加上配置就OK了
现在开发另一个接口spring也配置了但是又出了这个问题,求大神帮助
maven:
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper</artifactId>
<version>3.7.0</version>
</dependency>
spring:
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="typeAliasesPackage" value="com.seebon.entity" />
<property name="mapperLocations" value="classpath*:mybatis/**/*.xml" />
<property name="plugins">
<array>
<bean class="com.github.pagehelper.PageHelper">
<property name="properties">
<value>
dialect=mysql
reasonable=true
rowBoundsWithCount=true
offsetAsPageNum=true
pageSizeZero=true
</value>
</property>
</bean>
</array>
</property>
</bean>
程序报错代码:
List<CustomerDebtCollection> collection = new ArrayList<>();
PageHelper.startPage(1 , 1);
Page<CustomerDebtCollection> page = (Page<CustomerDebtCollection>)collection;
强转的时候就报类型不对
(collection size=2,因为中间业务代码太多就没有贴出来了)