View Javadoc
1   package org.itracker.persistence.dao;
2   
3   import org.hibernate.HibernateException;
4   import org.itracker.model.Report;
5   
6   import java.util.List;
7   
8   /**
9    *
10   */
11  public class ReportDAOImpl extends BaseHibernateDAOImpl<Report>
12          implements ReportDAO {
13  
14      public Report findByPrimaryKey(Integer id) {
15          try {
16              return (Report) getSession().get(Report.class, id);
17          } catch (HibernateException ex) {
18              throw convertHibernateAccessException(ex);
19          }
20      }
21  
22      @SuppressWarnings("unchecked")
23      public List<Report> findAll() {
24          try {
25              return getSession().getNamedQuery("ReportsAllQuery").list();
26          } catch (HibernateException ex) {
27              throw convertHibernateAccessException(ex);
28          }
29      }
30  
31  }