abel533 / Mybatis-Spring

这是一个集成了Mybatis分页插件和通用Mapper的示例项目
943 stars 610 forks source link

类转化异常 #25

Open pi408637535 opened 7 years ago

pi408637535 commented 7 years ago

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获取出来了数据,但是数据无法转化。这个是什么问题。同样的类

abel533 commented 7 years ago

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

Spring DevTools 配置