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

数据库自增GeneratedKey的返回无效,已经确认不支持。 #308

Closed
xuminwlt opened this issue Aug 2, 2017 · 1 comment
Closed

Comments

@xuminwlt
Copy link

xuminwlt commented Aug 2, 2017

Please answer these questions before submitting your issue. Thanks!

Which version of Sharding-Jdbc do you using?

1.5.0

Expected behavior

mysql自增id在Mybatis中能拿到

@options(useGeneratedKeys = true, keyProperty = "id" )
boolean add(User user);

Actual behavior

配置sjdbc的<rdb:generate-key-column column-name="id"/>意味着只能使用分布式id策略,无法满足现有需求,1.4.2一直可以的。

Steps to reproduce the behavior

INSERT INTO t_order ( user_id, status ) VALUES ( #{userId,jdbcType=INTEGER}, #{status,jdbcType=VARCHAR} )

Please provide the reproduce example codes (such as github link) if possible.

能够像1.4.2一样支持数据库自增id返回GeneratedKey策略,经过调试发现,GeneratedKey仅在配置分布式自增id才会生效。

terrymanu added a commit that referenced this issue Aug 2, 2017
terrymanu added a commit that referenced this issue Aug 2, 2017
@terrymanu
Copy link
Member

fixed at 1.5.1

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

No branches or pull requests

2 participants