SmsContentDAO extends BaseIbatisDAO { public void deleteByPrimaryKey(final Serializable id) { if (LOG.isDebugEnabled()) { LOG.debug("Want to delete id = " + id); } super.delete("SMS_CONTENT.deleteByPrimaryKey", id); }  SmsContent save(final SmsContent sms); @SuppressWarnings("unchecked") List<SmsContent> query(final Map<String, Object> parameters); void deleteByPrimaryKey(final Serializable id); void delete(final Map<String, Object> parameters); void updateFailureCount(final Serializable id); SmsContent getByPrimaryKey(final Serializable id); void retrySend(final Serializable serialId); static int getRule(); static void setRule(int rule); @SuppressWarnings("unchecked") List<SmsContent> queryByParam(Map<String, Object> param); void reSendSmsByMap(Map<Object, Object> extendParam); int update(SmsContent smsContent); void insert(SmsContent smsContent);  }
@Test public void testDeleteByPrimaryKey() throws Exception { SmsContent smsContent = new SmsContent("Test Sms", "13917677725"); smsContentDAO.save(smsContent); smsContentDAO.deleteByPrimaryKey(smsContent.getId()); Statement stat = conn.createStatement(); ResultSet rs = stat.executeQuery("select * from sms_content where content = 'Test Sms' and mobile = '13917677725'"); if (rs.next()) { fail("未能有效删除记录!"); } }