@Test public void testWC2_IsWordCountExisted_查看结果是否存在() { assertTrue(wordCount.isWordCountExisted("词语1")); assertTrue(wordCount.isWordCountExisted("词语2")); assertTrue(wordCount.isWordCountExisted("词语3")); assertFalse(wordCount.isWordCountExisted("词语33")); }
public boolean isWordCountExisted(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); if (wordCountDao.isWordCountExisted(word) == null) { return Boolean.FALSE; } return Boolean.TRUE; } }
WordCount { public boolean isWordCountExisted(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); if (wordCountDao.isWordCountExisted(word) == null) { return Boolean.FALSE; } return Boolean.TRUE; } } }
WordCount { public boolean isWordCountExisted(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); if (wordCountDao.isWordCountExisted(word) == null) { return Boolean.FALSE; } return Boolean.TRUE; } } WordCount(MybatisConfig.ServerEnum server); }
WordCount { public boolean isWordCountExisted(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); if (wordCountDao.isWordCountExisted(word) == null) { return Boolean.FALSE; } return Boolean.TRUE; } } 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 boolean isWordCountExisted(String word) { try (SqlSession sqlSession = sqlSessionFactory.openSession();) { WordCountDao wordCountDao = sqlSession.getMapper(WordCountDao.class); if (wordCountDao.isWordCountExisted(word) == null) { return Boolean.FALSE; } return Boolean.TRUE; } } 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);  }