Comments (12)
这个错只有 foreach 会出现,你分页用的什么版本?
from book.
if(page.getAutoCount() == 0) {
queryArgs[0] = this.clone(ms, ms.getBoundSql(parameterObject), page);
}
Future listFuture1 = this.call(new Callable() {
public List call() throws Exception {
return (List)invocation.proceed();
}
}, this.asyncCount);
page.setResult((List)listFuture1.get());
if(page.getAutoCount() == 0) {
Callable countTask = new Callable() {
public Object call() throws Exception {
Configuration configuration = ms.getConfiguration();
String countSql = PageLimitInterceptor.this.dialect.getCountSql(boundSql.getSql());
if(PageLimitInterceptor.logger.isDebugEnabled()) {
PageLimitInterceptor.logger.debug("生成count语句: " + countSql);
}
PreparedStatement countStmt = executor.getTransaction().getConnection().prepareStatement(countSql);
BoundSql countBS = PageLimitInterceptor.this.dialect.getBoundSql(configuration, countSql, boundSql);
PageLimitInterceptor.this.setParameters(countStmt, configuration, countBS, parameterObject);
ResultSet rs = countStmt.executeQuery();
long count = 0L;
if(rs.next()) {
count = rs.getLong(1);
}
rs.close();
countStmt.close();
return Long.valueOf(count);
}
};
Future countFuture = this.call(countTask, this.asyncCount);
page.setTotalCount(((Long)countFuture.get()).longValue());
}
return listFuture1.get();
问题就在这里,你所说的分页版本我暂时不清楚,mybatis 是3.4.1 的,拦截器是自己写的,没有用第三方的
from book.
分页插件的版本?
from book.
不用提供版本了,这个插件不是我写的,有这个问题很正常。。
我写的分页插件地址:https://github.com/pagehelper/Mybatis-PageHelper
from book.
是的
from book.
请问我这个啥原因么,我想知道
from book.
没有处理foreach生成的动态参数。
from book.
是mybatis的问题 还是我的拦截器的问题?这个是我之前网上找的!另外处理foreach生成的动态参数的代码能告诉我位置么
from book.
拦截器的问题
from book.
请教你另外一个问题,前天下载了一个阿里的开发人员注意手册,里面说到update同一个表的的同一条记录时候更新的字段的数目多少影响效率,和我自己理解的就不一样(应该是和数目没关系),update实际做的就是delete 和insert
from book.
这个问题只有大量测试才能看出来效果,不清楚数据库底层如何实现的update。
from book.
哦哦,谢谢了哈
from book.
Related Issues (20)
- 《MyBatis从入门到精通》(刘增辉)一书中,第96页代码案例缺失,我贡献一些自己写的案例。 HOT 2
- 可以支持对指定列的结果返回吗
- 建议增加项目mybatis-spring使用的注意事项 HOT 2
- 《MyBatis从入门到精通》(刘增辉)一书中,书签161页第3个存储过程创建是否有误? HOT 3
- 数据库Sqlserver2012 与 PageHelper 报错 HOT 2
- Provider注解 HOT 1
- 第8章 MyBatis插件开发 8.4.1 PageInterceptor拦截器类, 初始化 MappedStatement 报错。
- 批量逻辑删除有现成的方法可用吗?
- 【书籍勘误】第 5 章 MyBatis 代码生成器 中文文档链接失效
- 启动报warn No MyBatis mapper was found in '[com.xxx]' package. Please check your configuration.
- 几点建议
- 达梦数据库使用异常-java.lang.NoSuchMethodError: com.github.pagehelper.PageHelper.startPage(II) HOT 1
- tk.mybatis.mapper 如何查询被逻辑删除的数据
- 数据库结构.SQL的bigint
- Mybatis-book
- MyBatis从入门到精通 第一章的第一个demo 出现以下问题!!!请大佬不吝赐教 HOT 2
- 大神了解过 mybatis-dynamic-sql 这个项目吗 HOT 1
- mapper-spring-boot-starter与mapper HOT 1
- Oracle数据库使用PageHelper报错ORA-00918 HOT 1
- 书中文字勘误 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from book.