Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JADE报个bug:批量插入时,若批量list的size为1,会报错 #20

Open
wensong opened this issue Jun 11, 2014 · 2 comments
Open

Comments

@wensong
Copy link

wensong commented Jun 11, 2014

RT,
尝试bugfix如下,不知道是否合理
修改execute方法:

@OverRide
public Object execute(SQLType sqlType, StatementRuntime... runtimes) {
switch (runtimes.length) {
case 0:
return 0;
case 1:
/**
* runtime长度为1,也可能调用的是batchUpdate,
* 根据jdbcTemplate接口定义,是不是可以认为返回值为数组的,即为batchUpdate操作
*/
if(returnType.isArray()){
return executeBatch(runtimes);
}
return executeSingle(runtimes[0], returnType);
default:
return executeBatch(runtimes);
}
}

@wensong wensong changed the title 报个bug:批量插入时,若批量list为1,会报错 JADE报个bug:批量插入时,若批量list为1,会报错 Jun 11, 2014
@wensong wensong changed the title JADE报个bug:批量插入时,若批量list为1,会报错 JADE报个bug:批量插入时,若批量list的size为1,会报错 Jun 11, 2014
@zhuduan
Copy link

zhuduan commented Dec 27, 2016

我们也遇到这个问题,是在老的1.2.2版本上
对应看了下最新2.0u8版本的代码应该是解决了的

@nickwongwong
Copy link

nickwongwong commented Oct 12, 2017

更新到最新2.0u8版本,但老框架问题还是没解决呀=、=
org.springframework.dao.DataRetrievalFailureException: The generated key is not of a supported numeric type: [I
at net.paoding.rose.jade.statement.UpdateQuerier.executeSingle(UpdateQuerier.java:108)
at net.paoding.rose.jade.statement.UpdateQuerier.execute(UpdateQuerier.java:61)
at net.paoding.rose.jade.statement.JdbcStatement.execute(JdbcStatement.java:156)
at net.paoding.rose.jade.statement.cached.CachedStatement.execute(CachedStatement.java:98)
at net.paoding.rose.jade.context.JadeInvocationHandler.invoke(JadeInvocationHandler.java:118)
at com.sun.proxy.$Proxy109.saveBatch233(Unknown Source)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants