uklance / tader

A tool to quickly insert relational test data by generating the stuff you don't care about
8 stars 1 forks source link

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

Open uklance opened 8 years ago

uklance commented 8 years ago

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