xuejike / rapid-framework

Automatically exported from code.google.com/p/rapid-framework
0 stars 0 forks source link

MyBatis Criteria使用 OffsetLimitInterceptor.java分页报错 #63

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
MyBatis 3.0.2
调用mapper的select方法,使用MyBatis 
Generator生成的Criteria作为参数传入,同时传入参数RowBounds控制
分页,结果报错
There is no getter for property named '__frch_criterion_1' in 'class XXXX'

跟踪OffsetLimitInterceptor过程中发现
代码79行创建的newBoundSql相比较从MappedStatement中取得的boundSql��
�失了additionalParameters

之后在79行和80行之间加入代码
for (ParameterMapping mapping : boundSql.getParameterMappings()) {
                String prop = mapping.getProperty();
                if (boundSql.hasAdditionalParameter(prop)) {
                    newBoundSql.setAdditionalParameter(prop, boundSql.getAdditionalParameter(prop));
                }
            }
问题解决

Original issue reported on code.google.com by hbm...@gmail.com on 29 Oct 2010 at 3:03

GoogleCodeExporter commented 9 years ago
遵照你所说的方法进行修正.

Original comment by bad...@gmail.com on 30 Oct 2010 at 8:06

GoogleCodeExporter commented 9 years ago
这都2013年了,这个bug 还没修复呢。。。

Original comment by louwei.0...@gmail.com on 9 Jul 2013 at 8:06

GoogleCodeExporter commented 9 years ago
小问题自己修改一下就可以了

Original comment by micro1...@gmail.com on 9 Jul 2013 at 8:54