Ejemplo n.º 1
0
  public ReportDataSource getDataSource(String name) throws ProviderException {
    Session session = null;

    try {
      session = hibernateProvider.openSession();

      Criteria criteria = session.createCriteria(ReportDataSource.class);
      criteria.add(Restrictions.eq("name", name));

      return (ReportDataSource) criteria.uniqueResult();
    } catch (HibernateException he) {
      throw new ProviderException(he);
    } finally {
      hibernateProvider.closeSession(session);
    }
  }