Status: New
Owner: ----
Labels: Type-Defect Priority-Medium
New issue 63 by hbmayi: MyBatis Criteria使用 OffsetLimitInterceptor.java分页
报错
http://code.google.com/p/rapid-framework/issues/detail?id=63
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));
}
}
问题解决