Exemplo n.º 1
0
 public void execute(final Connection connection) {
   PreparedStatement insert = null;
   try {
     insert = connection.prepareStatement(buildInsertStatement(), RETURN_GENERATED_KEYS);
     into.dehydrate(insert, entity);
     executeInsert(insert);
     into.handleKeys(insert.getGeneratedKeys(), entity);
   } catch (SQLException e) {
     throw new JDBCException("Could not insert entity " + entity, e);
   } finally {
     JDBC.close(insert);
   }
 }