@Test public void testDelete() { backUpInfoDao.delete(1L); BackUpInfo[] backUpInfos = new BackUpInfo[2]; backUpInfos[0] = new BackUpInfo(1, "test", "test", 1); backUpInfos[1] = new BackUpInfo(2, "test", "test", 1); backUpInfoDao.insert(backUpInfos); backUpInfoDao.delete(1L); Assert.assertTrue(backUpInfoDao.getByRid(2).equals(backUpInfos[1])); try { backUpInfoDao.getByRid(1); } catch (EmptyResultDataAccessException e) { } }
public void delete(long rid) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); final String sql = "DELETE FROM backup_file WHERE rid = ?"; jdbcTemplate.update(sql, rid); }
BackUpInfoDao { public void delete(long rid) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); final String sql = "DELETE FROM backup_file WHERE rid = ?"; jdbcTemplate.update(sql, rid); } }
BackUpInfoDao { public void delete(long rid) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); final String sql = "DELETE FROM backup_file WHERE rid = ?"; jdbcTemplate.update(sql, rid); } BackUpInfoDao(DataSource dataSource); }
BackUpInfoDao { public void delete(long rid) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); final String sql = "DELETE FROM backup_file WHERE rid = ?"; jdbcTemplate.update(sql, rid); } BackUpInfoDao(DataSource dataSource); void setDataSource(DataSource dataSource); List<BackUpInfo> getAll(); List<BackUpInfo> getByIds(List<Long> rids); int getCountByRid(int rid); BackUpInfo getByRid(long rid); List<BackUpInfo> getBySrc(String src); List<BackUpInfo> getByDest(String dest); void delete(long rid); void insert(BackUpInfo backUpInfo); void insert(BackUpInfo[] backUpInfos); int update(long rid, long period); void deleteAll(); }
BackUpInfoDao { public void delete(long rid) { JdbcTemplate jdbcTemplate = new JdbcTemplate(dataSource); final String sql = "DELETE FROM backup_file WHERE rid = ?"; jdbcTemplate.update(sql, rid); } BackUpInfoDao(DataSource dataSource); void setDataSource(DataSource dataSource); List<BackUpInfo> getAll(); List<BackUpInfo> getByIds(List<Long> rids); int getCountByRid(int rid); BackUpInfo getByRid(long rid); List<BackUpInfo> getBySrc(String src); List<BackUpInfo> getByDest(String dest); void delete(long rid); void insert(BackUpInfo backUpInfo); void insert(BackUpInfo[] backUpInfos); int update(long rid, long period); void deleteAll();  }