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

Specify explicit columns for generated keys. Allow multiple columns to be auto generated by database #6

Open
uklance opened this issue Mar 30, 2016 · 0 comments

Comments

@uklance
Copy link
Owner

uklance commented Mar 30, 2016

Currently, the generated key logic is a bit silly. It simply states to use Statement.RETURN_GENERATED_KEYS and can only return a single generated value. Ie it currently uses:

Connection.prepareStatement(String sql, int autoGeneratedKeys)

This should be improved and should use either

prepareStatement(String sql, int[] columnIndexes)

or

prepareStatement(String sql, String[] columnNames) 

Then we can populate more than one database generated value per insert

See
DefaultInsertHandler
JdbcEntityPersistence

@uklance uklance changed the title Make getGeneratedKey smarter Specify explicit columns for generated keys. Allow multiple columns to be auto generated by database Mar 30, 2016
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

1 participant