ballchaichana

DocumentDAO

Sep 16th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.57 KB | None | 0 0
  1.     public List<DocumentDB> findByDateAndYear2 (int month ,int year ,UserUidDB userUID) {
  2.         List<DocumentDB> historyTotal = null;
  3.         try {
  4.  
  5.                 DAO.begin();
  6.                 historyTotal = (List<DocumentDB>) DAO.getEntityManager().createNamedQuery("getHistoryTotalByMonthAndYear2")
  7.                         .setParameter("monthDoc", month)
  8.                         .setParameter("yearDoc", year)
  9.                         .setParameter("creator", userUID)
  10.                         .getResultList();
  11.  
  12.            
  13.         } catch (Exception e) {
  14.             logger.error("Invalid month/year loading with "+month+"/"+year , e);
  15.         } finally {
  16.             DAO.close();
  17.         }
  18.         return historyTotal;
  19.     }
Advertisement
Add Comment
Please, Sign In to add comment