detail.session = session;
Dashboard dashboard = new Dashboard(0,0);
ReportDAO reportDAO = new ReportDAO();
Report report = new Report();
report.setName("reportTest");
report.setUser(user.findById(1l));
report.setDashboard(dashboard);
report.setNumRecordsPerPage(25);
ReportDesign design = new ReportDesign();
design.setMappingAxis("x");
design.setColumnAlias(detail.findById(99999l));
design.setReport(report);
report.setReportType(type.findById(1l));
ArrayList<ReportDesign> designs = new ArrayList<ReportDesign>();
designs.add(design);
report.setDesigns(designs);
GroupBys groupBys = new GroupBys();
RowAlias alias = new RowAlias();
alias.setId(99999);
RowAlias alias1 = new RowAlias();
alias1.setId(19999);
List<GroupBy> groupByList = new ArrayList<GroupBy>();
GroupBy groupBy = new GroupBy();
groupBy.setRowAlias(alias);
groupBy.setPosition(1);
GroupBy groupBy1 = new GroupBy();
groupBy1.setRowAlias(alias1);
groupBy1.setPosition(2);
groupByList.add(groupBy);
groupByList.add(groupBy1);
groupBys.setGroupBy(groupByList);
groupBys.setReport(report);
report.setGroupBys(groupBys);
reportDAO.session = session;
reportDAO.transaction = reportDAO.session.getTransaction();
long reportId = reportDAO.save(report);
long designId = design.getId();