if (rpJoin.getReportId().equals(prevReportId)) {
// more than one parameter for report
if (reportParameters == null) {
reportParameters = new ArrayList<>();
}
reportParameters.add(new ReportParameterData(rpJoin.getReportParameterId(), rpJoin.getParameterId(), rpJoin
.getReportParameterName(), rpJoin.getParameterName()));
} else {
if (firstReport) {
firstReport = false;
} else {
// write report entry
reportList.add(new ReportData(reportId, reportName, reportType, reportSubType, reportCategory, description, reportSql,
coreReport, useReport, reportParameters));
}
prevReportId = rpJoin.getReportId();
reportId = rpJoin.getReportId();
reportName = rpJoin.getReportName();
reportType = rpJoin.getReportType();
reportSubType = rpJoin.getReportSubType();
reportCategory = rpJoin.getReportCategory();
description = rpJoin.getDescription();
reportSql = rpJoin.getReportSql();
coreReport = rpJoin.getCoreReport();
useReport = rpJoin.getUseReport();
if (rpJoin.getReportParameterId() != null) {
// report has at least one parameter
reportParameters = new ArrayList<>();
reportParameters.add(new ReportParameterData(rpJoin.getReportParameterId(), rpJoin.getParameterId(), rpJoin
.getReportParameterName(), rpJoin.getParameterName()));
} else {
reportParameters = null;
}
}