Skip to content

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

Description

@wensong

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);
}
}

Activity

  1. changed the title [-]报个bug:批量插入时,若批量list为1,会报错[/-] [+]JADE报个bug:批量插入时,若批量list为1,会报错[/+] on Jun 11, 2014
  2. changed the title [-]JADE报个bug:批量插入时,若批量list为1,会报错[/-] [+]JADE报个bug:批量插入时,若批量list的size为1,会报错[/+] on Jun 11, 2014
  3. zhuduan commented on Dec 27, 2016

    @zhuduan

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

  4. nickwongwong commented on Oct 12, 2017

    @nickwongwong

    更新到最新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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions