日期:2014-05-17  浏览次数:20771 次

mybatis3.0.5物理分页问题
mybatis的物理分页支持烦了好几天了,没进展!
例子我是从这里看到的!
http://lihongfu-84.blog.163.com/blog/static/8270304201174113252416/
代码是从google code下载下来的
http://20110311start.googlecode.com/svn/trunk/
谁能告诉我,
RowBounds rowBounds = (RowBounds)metaStatementHandler.getValue("delegate.rowBounds");
delegate.rowBounds是什么意思?这个属生是mybatis自己的,还是作者自己在properties文件自己写的属性?
相应的地方还有:
Configuration configuration = (Configuration)metaStatementHandler.getValue("delegate.configuration");


String originalSql = (String)metaStatementHandler.getValue("delegate.boundSql.sql");
metaStatementHandler.setValue("delegate.boundSql.sql", dialect.getLimitString(originalSql, rowBounds.getOffset(), rowBounds.getLimit()) );
metaStatementHandler.setValue("delegate.rowBounds.offset", RowBounds.NO_ROW_OFFSET );
metaStatementHandler.setValue("delegate.rowBounds.limit", RowBounds.NO_ROW_LIMIT );

像这些:delegate.boundSql.sql,都不知道是什么意思,在哪里可以配置的?!

------解决方案--------------------
实例如下:上面所有的metaStatementHandler.getValue("****")都是mybatis自己的
return (ArrayList) this.getSqlSession().selectList("com.aspirehld.mapper.ChannelMapper.getObject", chnl,new RowBounds(1, 1));
delegate.boundSql.sql 获取你调用的sql
delegate.rowBounds 获取new RowBounds(1, 1)