mybatis逆向工程带条件查询用PageHelper分页插件出错

问题:

There is no getter for property named '__frch_criterion_1' in 'class com.××.××.TbContentExample'。可是我并没有定义这个变量。

代码如下:

//执行查询
TbContentExample example = new TbContentExample();
Criteria criteria = example.createCriteria();
criteria.andCategoryIdEqualTo(((long)categoryId));
        
//分页处理
PageHelper.startPage(1, 10);
List<TbContent> list = contentMapper.selectByExampleWithBLOBs(example);
View Code

分析:

把条件注释掉或者分页注释掉正常使用。个人猜测可能是分页插件和逆向工程不兼容。

解决:

其实是还没解决,最后自己写了mapper和xml查询。记录一下,md找了一下午原因

posted @ 2018-03-08 17:45  maplefighting  阅读(1416)  评论(0编辑  收藏  举报