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

Unable to get auto-generated ID with mysql using annotations #184

Closed
GoogleCodeExporter opened this issue Mar 17, 2015 · 1 comment
Closed

Comments

@GoogleCodeExporter
Copy link

This is a standard flow in any DAL - insert a new record, and get the new 
auto-generated / auto-incremented ID.
I haven't found how to do this with mybatis. 

I found this question on how to do it on Postgres, but it doesn't work for me 
on mysql. 
http://stackoverflow.com/questions/4260428/mybatis-how-to-return-the-id-of-the-i
nserted-object-under-postgres

I'm cross-posting this to Stack Overflow
http://stackoverflow.com/questions/4283159/howto-return-ids-on-inserts-with-myba
tis-in-mysql-with-annotations


Original issue reported on code.google.com by ron.gr...@gmail.com on 26 Nov 2010 at 7:21

@GoogleCodeExporter
Copy link
Author

Fixed with new @SelectKey annotation

Original comment by jeffgbut...@gmail.com on 29 Dec 2010 at 11:43

  • Changed state: Duplicate

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

1 participant