@Test public void testWC3_UpdateWordCount_更新词频统计结果() { long actualReturn = 0; try { wordCount.updateWordCount("词语1", 13); } catch (Exception e) { actualReturn = -1; } assertEquals(0L, actualReturn); }
public void updateWordCount(String word, int count) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); wordCountDao.updateWordCount(word, count); sqlSession.commit(); } }
WordCount { public void updateWordCount(String word, int count) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); wordCountDao.updateWordCount(word, count); sqlSession.commit(); } } }
WordCount { public void updateWordCount(String word, int count) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); wordCountDao.updateWordCount(word, count); sqlSession.commit(); } } WordCount(MybatisConfig.ServerEnum server); }
WordCount { public void updateWordCount(String word, int count) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); wordCountDao.updateWordCount(word, count); sqlSession.commit(); } } WordCount(MybatisConfig.ServerEnum server); void addWordCountByOne(String word); void deleteWordCount(String word); void insertWordCount(String tablename, String word, int count); boolean isWordCountExisted(String word); int selectWordCountByWord(String word); List<WordAndCount> selectWordCountTopN(int N); void updateWordCount(String word, int count); }
WordCount { public void updateWordCount(String word, int count) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); wordCountDao.updateWordCount(word, count); sqlSession.commit(); } } WordCount(MybatisConfig.ServerEnum server); void addWordCountByOne(String word); void deleteWordCount(String word); void insertWordCount(String tablename, String word, int count); boolean isWordCountExisted(String word); int selectWordCountByWord(String word); List<WordAndCount> selectWordCountTopN(int N); void updateWordCount(String word, int count);  }