コード例 #1
0
  @SuppressWarnings("unchecked")
  public List<ReportDataSource> getDataSources() throws ProviderException {
    String fromClause =
        "from org.efs.openreports.objects.ReportDataSource reportDataSource order by reportDataSource.name ";

    return (List<ReportDataSource>) hibernateProvider.query(fromClause);
  }
コード例 #2
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);
    }
  }
コード例 #3
0
 public void deleteReportParameter(ReportParameter reportParameter) throws ProviderException {
   try {
     hibernateProvider.delete(reportParameter);
   } catch (ConstraintException ce) {
     throw new ProviderException(LocalStrings.ERROR_PARAMETER_DELETION);
   }
 }
コード例 #4
0
  @SuppressWarnings("unchecked")
  public List<ReportParameter> getReportParameters() throws ProviderException {
    String fromClause =
        "from org.efs.openreports.objects.ReportParameter reportParameter order by reportParameter.name ";

    return (List<ReportParameter>) hibernateProvider.query(fromClause);
  }
コード例 #5
0
 public void deleteDataSource(ReportDataSource dataSource) throws ProviderException {
   try {
     hibernateProvider.delete(dataSource);
     dataSources.remove(dataSource.getId());
   } catch (ConstraintException ce) {
     throw new ProviderException(LocalStrings.ERROR_DATASOURCE_DELETION);
   }
 }
コード例 #6
0
  public ReportDataSource insertDataSource(ReportDataSource dataSource) throws ProviderException {
    testDataSource(dataSource);

    dataSource = (ReportDataSource) hibernateProvider.save(dataSource);
    dataSources.put(dataSource.getId(), dataSource);

    return dataSource;
  }
コード例 #7
0
 public ReportDataSource getDataSource(Integer id) throws ProviderException {
   return (ReportDataSource) hibernateProvider.load(ReportDataSource.class, id);
 }
コード例 #8
0
  public void updateDataSource(ReportDataSource dataSource) throws ProviderException {
    testDataSource(dataSource);

    hibernateProvider.update(dataSource);
    dataSources.put(dataSource.getId(), dataSource);
  }
コード例 #9
0
 public void updateReportParameter(ReportParameter reportParameter) throws ProviderException {
   hibernateProvider.update(reportParameter);
 }
コード例 #10
0
 public ReportParameter insertReportParameter(ReportParameter reportParameter)
     throws ProviderException {
   return (ReportParameter) hibernateProvider.save(reportParameter);
 }
コード例 #11
0
 public ReportParameter getReportParameter(Integer id) throws ProviderException {
   return (ReportParameter) hibernateProvider.load(ReportParameter.class, id);
 }