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;
 }
 public List<HockeyMatch> findAll() {
   dao.openCurrentSession();
   List<HockeyMatch> books = dao.findAll();
   dao.closeCurrentSession();
   return books;
 }
 public void update(HockeyMatch entity) {
   dao.openCurrentSessionwithTransaction();
   dao.update(entity);
   dao.closeCurrentSessionwithTransaction();
 }
 public HockeyMatch findById(Long id) {
   dao.openCurrentSession();
   HockeyMatch book = dao.findById(id);
   dao.closeCurrentSession();
   return book;
 }
 public void persist(HockeyMatch entity) {
   dao.openCurrentSessionwithTransaction();
   dao.persist(entity);
   dao.closeCurrentSessionwithTransaction();
 }