Last active
May 23, 2018 11:30
-
-
Save bdarfler/1cca45cfabc42a6782babb011428fbdf to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get Datasource from Spring Context | |
SimpleJdbcInsert jdbcInsert = new SimpleJdbcInsert( dataSource ).withTableName( dbObj.getTableName() ).usingGeneratedKeyColumns( "id" ); | |
final int id = jdbcInsert.executeAndReturnKey( new BeanPropertySqlParameterSource( dbObj ) ).intValue(); | |
dbObj.setId( id ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment