提交 1407adfe 编写于 作者: T terrymanu

fix #308

上级 18ab7696
## 1.5.1
### 缺陷修正
1. [ISSUE #308](https://github.com/dangdangdotcom/sharding-jdbc/issues/308) 数据库原生的自增GeneratedKey的返回无效
## 1.5.0 ## 1.5.0
### 里程碑 ### 里程碑
......
...@@ -226,6 +226,9 @@ public class ShardingStatement extends AbstractStatementAdapter { ...@@ -226,6 +226,9 @@ public class ShardingStatement extends AbstractStatementAdapter {
if (generatedKey.isPresent() && returnGeneratedKeys) { if (generatedKey.isPresent() && returnGeneratedKeys) {
return new GeneratedKeysResultSet(routeResult.getGeneratedKeys().iterator(), generatedKey.get().getColumn(), this); return new GeneratedKeysResultSet(routeResult.getGeneratedKeys().iterator(), generatedKey.get().getColumn(), this);
} }
if (1 == getRoutedStatements().size()) {
return getRoutedStatements().iterator().next().getGeneratedKeys();
}
return new GeneratedKeysResultSet(); return new GeneratedKeysResultSet();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册