abel533/Mybatis-Spring

类转化异常

pi408637535 opened this issue · 1 comments

java.lang.ClassCastException: tk.mybatis.springboot.model.PayProductCategory cannot be cast to tk.mybatis.springboot.model.PayProductCategory

PayProductCategory payProductCategorySelectCount = new PayProductCategory();
payProductCategorySelectCount.setState((byte)ShopConstants.State.LIVE.ordinal());
List payProductCategories = payProductCategoryMapper.select(payProductCategorySelectCount);

for(int i = 0; i < payProductCategories.size(); i++){
PayProductCategory payProductCategory = payProductCategories.get(i); //这里报错
Long productCategoryId = payProductCategory.getId();
}
}

利用payProductCategoryMapper获取出来了数据,但是数据无法转化。这个是什么问题。同样的类

https://github.com/abel533/Mapper 首页

Spring DevTools 配置