コード例 #1
0
 public List<HockeyMatch> findAllByChampionship(Championship championship) {
   dao.openCurrentSession();
   List<HockeyMatch> matches = dao.findAll();
   dao.closeCurrentSession();
   matches =
       matches
           .stream()
           .filter(match -> match.getChampionship().equals(championship))
           .collect(Collectors.toList());
   return matches;
 }
コード例 #2
0
 public List<HockeyMatch> findAll() {
   dao.openCurrentSession();
   List<HockeyMatch> books = dao.findAll();
   dao.closeCurrentSession();
   return books;
 }