List of usage examples for org.hibernate ScrollableResults next
boolean next();
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getLicenseBaselineReport(Account pAccount, String remoteUser, String lsName, PrintWriter pPrintWriter, boolean pbCustomerOwnedCustomerManagedSearchChecked, boolean pbCustomerOwnedIBMManagedSearchChecked, boolean pbIBMOwnedIBMManagedSearchChecked, boolean pbIBMO3rdMSearchChecked, boolean pbCustO3rdMSearchChecked, boolean pbIBMOibmMSWCOSearchChecked, boolean pbCustOibmMSWCOSearchChecked, boolean pbTitlesNotSpecifiedInContractScopeSearchChecked, boolean pbSelectAllChecked) throws HibernateException, Exception { String lsBaseSelectAndFromClause = "SELECT COALESCE(S.software_name, L.Full_Desc) AS Product_Name, CASE LENGTH(COALESCE(S.software_name, '')) WHEN 0 THEN 'No' ELSE 'Yes' END, L.Full_Desc,L.SKU, L.PID as swproPID, CONCAT(CONCAT(RTRIM(CHAR(CT.Code)), '-'), CT.Description), L.environment, L.Quantity, coalesce(L.Quantity - sum(VLUQ.Used_Quantity), L.Quantity), L.Expire_Date,L.END_DATE, L.Po_Number, L.Cpu_Serial, CASE L.IBM_Owned WHEN 1 THEN 'IBM' ELSE 'Customer' END, L.Ext_Src_Id, CASE L.Pool WHEN 0 THEN 'No' ELSE 'Yes' END, L.Record_Time FROM EAADMIN.License L LEFT OUTER JOIN EAADMIN.License_Sw_Map LSWM ON LSWM.License_Id = L.Id LEFT OUTER JOIN EAADMIN.software S ON S.software_id = LSWM.Software_Id LEFT OUTER JOIN EAADMIN.USED_LICENSE VLUQ ON VLUQ.License_Id = L.Id, EAADMIN.Capacity_Type CT"; String lsBaseWhereClause = "WHERE L.Customer_Id = :customerId AND L.Status = 'ACTIVE' AND CT.Code = L.Cap_Type"; StringBuffer lsbSql = new StringBuffer(); StringBuffer lsbScopeSql = new StringBuffer(); ScrollableResults lsrReport = null; if (!((pbCustomerOwnedCustomerManagedSearchChecked && pbCustomerOwnedIBMManagedSearchChecked && pbIBMOwnedIBMManagedSearchChecked && pbTitlesNotSpecifiedInContractScopeSearchChecked && pbIBMO3rdMSearchChecked && pbCustO3rdMSearchChecked && pbIBMOibmMSWCOSearchChecked && pbCustOibmMSWCOSearchChecked) || pbSelectAllChecked)) { if (pbCustomerOwnedCustomerManagedSearchChecked || pbCustomerOwnedIBMManagedSearchChecked || pbIBMOwnedIBMManagedSearchChecked || pbIBMO3rdMSearchChecked || pbCustO3rdMSearchChecked || pbIBMOibmMSWCOSearchChecked || pbCustOibmMSWCOSearchChecked) { lsbSql.append(lsBaseSelectAndFromClause).append(", EAADMIN.Schedule_F SF ") .append(lsBaseWhereClause); if (pbCustomerOwnedCustomerManagedSearchChecked) { lsbScopeSql.append("1"); }//from w w w. j a v a 2 s . c o m if (pbCustomerOwnedIBMManagedSearchChecked) { if (lsbScopeSql.length() > 0) { lsbScopeSql.append(", 2"); } else { lsbScopeSql.append("2"); } } if (pbIBMOwnedIBMManagedSearchChecked) { if (lsbScopeSql.length() > 0) { lsbScopeSql.append(", 3"); } else { lsbScopeSql.append("3"); } } if (pbIBMO3rdMSearchChecked) { if (lsbScopeSql.length() > 0) { lsbScopeSql.append(", 4"); } else { lsbScopeSql.append("4"); } } if (pbCustO3rdMSearchChecked) { if (lsbScopeSql.length() > 0) { lsbScopeSql.append(", 5"); } else { lsbScopeSql.append("5"); } } if (pbIBMOibmMSWCOSearchChecked) { if (lsbScopeSql.length() > 0) { lsbScopeSql.append(", 6"); } else { lsbScopeSql.append("6"); } } if (pbCustOibmMSWCOSearchChecked) { if (lsbScopeSql.length() > 0) { lsbScopeSql.append(", 7"); } else { lsbScopeSql.append("7"); } } lsbSql.append( " AND SF.Customer_Id = L.Customer_Id AND SF.Software_Id = S.software_id AND SF.Scope_Id IN (") .append(lsbScopeSql).append(") ") .append(pbTitlesNotSpecifiedInContractScopeSearchChecked ? "UNION " : ""); } if (pbTitlesNotSpecifiedInContractScopeSearchChecked) { lsbSql.append(lsBaseSelectAndFromClause).append(" ").append(lsBaseWhereClause).append( " AND NOT EXISTS (SELECT SF.Software_Id FROM EAADMIN.Schedule_F SF, EAADMIN.Status ST WHERE SF.Customer_Id = :customerId AND SF.Software_Id = S.software_id AND ST.Id = SF.Status_Id AND ST.Description = 'ACTIVE') "); } } else { lsbSql.append(lsBaseSelectAndFromClause).append(" ").append(lsBaseWhereClause).append(" "); } lsbSql.append( "group by COALESCE(S.software_name, L.Full_Desc), CASE LENGTH(COALESCE(S.software_name, '')) WHEN 0 THEN 'No' ELSE 'Yes' END, L.Full_Desc, L.SKU, L.PID, CONCAT(CONCAT(RTRIM(CHAR(CT.Code)), '-'), CT.Description),L.environment, L.Quantity, L.Expire_Date,L.END_DATE, L.Po_Number, L.Cpu_Serial, CASE L.IBM_Owned WHEN 1 THEN 'IBM' ELSE 'Customer' END, L.Ext_Src_Id, CASE L.Pool WHEN 0 THEN 'No' ELSE 'Yes' END, L.Record_Time "); lsbSql.append("ORDER BY Product_Name ASC"); lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery(lsbSql.toString()) .setLong("customerId", pAccount.getId()).scroll(ScrollMode.FORWARD_ONLY); printHeader(LICENSE_BASELINE_REPORT_NAME, pAccount.getAccount(), LICENSE_BASELINE_COLUMN_HEADERS, pPrintWriter); while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); } lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getNonWorkstationAccountsReport(String remoteUser, String lsName, PrintWriter pPrintWriter) throws HibernateException, Exception { ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery( "SELECT C.Account_Number, C.Customer_Name, CT.Customer_Type_Name, G.Name AS G_Name, R.Name AS R_Name, CC.Name AS CC_Name, S.Sector_Name, COUNT(H.Id), H.Hardware_Status FROM EAADMIN.Customer C, EAADMIN.Customer_Type CT, EAADMIN.Country_Code CC, EAADMIN.Region R, EAADMIN.Geography G, EAADMIN.Sector S, EAADMIN.Hardware H, EAADMIN.Machine_Type MT WHERE C.Status = 'ACTIVE' AND C.Customer_Type_Id = CT.Customer_Type_Id AND CT.Customer_Type_Name NOT LIKE '%WORKSTATION%' AND G.Id = R.Geography_Id AND R.Id = CC.Region_Id AND CC.Id = C.Country_Code_Id AND S.Sector_Id = C.Sector_Id AND H.Customer_Id = C.Customer_Id AND H.Status = 'ACTIVE' AND MT.Id = H.Machine_Type_Id AND MT.Type = 'WORKSTATION' GROUP BY C.Account_Number, C.Customer_Name, CT.Customer_Type_Name, G.Name, R.Name, CC.Name, S.Sector_Name, H.Hardware_Status ORDER BY C.Account_Number, H.Hardware_Status") .scroll(ScrollMode.FORWARD_ONLY); printHeader(NON_WORKSTATION_ACCOUNTS_REPORT_NAME, null, NON_WORKSTATION_ACCOUNTS_REPORT_COLUMN_HEADERS, pPrintWriter);// w ww . java 2 s.com while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); } lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getReconciliationSummaryReport(Account pAccount, String remoteUser, String lsName, PrintWriter pPrintWriter) throws HibernateException, Exception { ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery("select " + " COALESCE (det.software_name,lic.software_name) " + " ,COALESCE(count(det.isw_id),0) " + " ,COALESCE ((count(det.isw_id) - sum(det.open)),0) " + " ,COALESCE (sum(det.open),0) " + " ,COALESCE(lic.free,0) " + " ,COALESCE(lic.pool_type,'') " + " ,COALESCE(det.swOwner,'') " + " from " + " " + " (select " + " sw.software_name as software_name " + " ,sw.software_id as software_id " + " ,isw.id as isw_id " + " ,AUS.Open as open " + " ,COALESCE ( CAST ( (select scop.description from eaadmin.scope scop join eaadmin.schedule_f sf on sf.scope_id = scop.id where sf.customer_id = :customerId and sf.status_id=2 and sf.software_name = sw.software_name and ( ( sf.level = 'PRODUCT' ) or (( sf.hostname = sl.name ) and ( level = 'HOSTNAME' )) or (( sf.serial = h.serial ) and ( sf.machine_type = mt.name ) and ( sf.level = 'HWBOX' )) or (( sf.hw_owner = h.owner ) and ( sf.level ='HWOWNER' )) ) order by sf.LEVEL fetch first 1 rows only) as varchar(64) ), 'Not specified' ) as swOwner " + " from " + " eaadmin.software_lpar sl " + " join eaadmin.installed_software isw on (sl.id = isw.software_lpar_id) " + " join eaadmin.alert_unlicensed_sw aus on (isw.id = aus.installed_software_id) " + " join eaadmin.hw_sw_composite hwsw on (sl.id = hwsw.software_lpar_id) " + " join eaadmin.hardware_lpar hl on (hwsw.hardware_lpar_id = hl.id and sl.customer_id = hl.customer_id) " + " join eaadmin.hardware h on (hl.hardware_id = h.id) " + " join eaadmin.machine_type mt on (h.machine_type_id = mt.id) " + " join eaadmin.software sw on (sw.software_id = isw.software_id) " + " " + " where " + " (exists (select 1 from eaadmin.reconcile r where isw.id = r.installed_software_id) or (aus.open = 1)) " + " and sl.customer_id = :customerId " + " ) det " + " " + " full outer join " + " ( select " + " l.software_id software_id " + " ,quantity.quantity - l.used free " + " ,l.pool_type pool_type " + " ,quantity.software_name software_name " + " from " + " ( select " + " lsm.software_id as software_id " + " ,COALESCE (sum(l.quantity),0) as quantity " + " ,sw.software_name as software_name " + " from " + " eaadmin.license l " + " join eaadmin.license_sw_map lsm on (l.id = lsm.license_id and l.status = 'ACTIVE') " + " join eaadmin.software sw on ( sw.software_id = lsm.software_id ) " + " where l.customer_id= :customerId " + " group by lsm.software_id,sw.software_name " + " ) quantity " + " join ( " + " select " + " lsm.software_id as software_id " + " ,(RTRIM(CAST(ct.code AS CHAR(8) )) || ' - ' || ct.description ) as pool_type " + " ,COALESCE (sum(ul.used_quantity),0) used " + " from " + " eaadmin.license l " + " join eaadmin.license_sw_map lsm on (l.id = lsm.license_id and l.status = 'ACTIVE') " + " left outer join eaadmin.used_license ul on (l.id = ul.license_id) " + " left outer join eaadmin.capacity_type ct on (l.cap_type = ct.code) " + " where l.customer_id= :customerId " + " group by lsm.software_id,ct.code,ct.description " + " ) l on (l.software_id = quantity.software_id) " + " " + " ) lic on ( det.software_id = lic.software_id ) " + " group by " + " det.software_name " + " ,lic.software_name " + " ,det.swOwner " + " ,lic.pool_type " + " ,lic.free " + " order by 1 " + " with ur ") .setLong("customerId", pAccount.getId()).scroll(ScrollMode.FORWARD_ONLY); printHeader(RECONCILIATION_SUMMARY_REPORT_NAME, pAccount.getAccount(), RECONCILIATION_SUMMARY_COLUMN_HEADERS, pPrintWriter); while (lsrReport.next()) { pPrintWriter.println(outputReconciliationSummaryData(lsrReport.get())); }/*from w w w .j a va 2 s. c o m*/ lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getCauseCodeSummaryReport(Account pAccount, String remoteUser, String lsName, PrintWriter pPrintWriter) throws HibernateException, Exception { ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery( "SELECT VA.CAUSE_CODE_ALERT_TYPE,count(*),CASE WHEN VA.Alert_Age > 90 THEN 'Red' WHEN VA.Alert_Age > 45 THEN 'Yellow' ELSE 'Green' END as color,VA.AC_NAME, VA.AC_RESPONSIBILITY from v_alerts VA where VA.Customer_Id = :customerId and VA.open = 1 group by VA.CAUSE_CODE_ALERT_TYPE,VA.AC_NAME, (CASE WHEN VA.Alert_Age > 90 THEN 'Red' WHEN VA.Alert_Age > 45 THEN 'Yellow' ELSE 'Green' END) ,VA.AC_RESPONSIBILITY order by VA.CAUSE_CODE_ALERT_TYPE,VA.AC_NAME, (CASE WHEN VA.Alert_Age > 90 THEN 'Red' WHEN VA.Alert_Age > 45 THEN 'Yellow' ELSE 'Green' END) ,VA.AC_RESPONSIBILITY ") .setLong("customerId", pAccount.getId()).scroll(ScrollMode.FORWARD_ONLY); printHeader(CAUSE_CODE_SUMMARY_REPORT_NAME, pAccount.getAccount(), CAUSE_CODE_SUMMARY_REPORT_COLUMN_HEADERS, pPrintWriter);/*from w ww . j a va 2s. com*/ while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); } lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getSoftwareComplianceSummaryReport(Account pAccount, String remoteUser, String lsName, PrintWriter pPrintWriter, boolean pbCustomerOwnedCustomerManagedSearchChecked, boolean pbCustomerOwnedIBMManagedSearchChecked, boolean pbIBMOwnedIBMManagedSearchChecked, boolean pbIBMO3rdMSearchChecked, boolean pbCustO3rdMSearchChecked, boolean pbIBMOibmMSWCOSearchChecked, boolean pbCustOibmMSWCOSearchChecked, boolean pbTitlesNotSpecifiedInContractScopeSearchChecked, boolean pbSelectAllChecked) throws HibernateException, Exception { if (pbSelectAllChecked) { pbCustomerOwnedCustomerManagedSearchChecked = true; pbCustomerOwnedIBMManagedSearchChecked = true; pbIBMOwnedIBMManagedSearchChecked = true; pbIBMO3rdMSearchChecked = true;/*from ww w .j a v a2s .c o m*/ pbCustO3rdMSearchChecked = true; pbIBMOibmMSWCOSearchChecked = true; pbCustOibmMSWCOSearchChecked = true; pbTitlesNotSpecifiedInContractScopeSearchChecked = true; } ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery( "CALL EAADMIN.SwComplianceSum(:customerId, :customerOwnedCustomerManaged, :customerOwnedIBMManaged, :ibmOwnedIBMManaged, :ibmOwned3RDManaged, :customerOwned3RDManaged, :ibmOwnedIbmManagedSWConsumBased, :custOwnedIbmManagedSWConsumBased, :titlesNotSpecifiedInContractScope)") .setLong("customerId", pAccount.getId()) .setInteger("customerOwnedCustomerManaged", pbCustomerOwnedCustomerManagedSearchChecked ? 1 : 0) .setInteger("customerOwnedIBMManaged", pbCustomerOwnedIBMManagedSearchChecked ? 1 : 0) .setInteger("ibmOwnedIBMManaged", pbIBMOwnedIBMManagedSearchChecked ? 1 : 0) .setInteger("ibmOwned3RDManaged", pbIBMO3rdMSearchChecked ? 1 : 0) .setInteger("customerOwned3RDManaged", pbCustO3rdMSearchChecked ? 1 : 0) .setInteger("ibmOwnedIbmManagedSWConsumBased", pbIBMOibmMSWCOSearchChecked ? 1 : 0) .setInteger("custOwnedIbmManagedSWConsumBased", pbCustOibmMSWCOSearchChecked ? 1 : 0) .setInteger("titlesNotSpecifiedInContractScope", pbTitlesNotSpecifiedInContractScopeSearchChecked ? 1 : 0) .scroll(ScrollMode.FORWARD_ONLY); printHeader(SOFTWARE_COMPLIANCE_SUMMARY_REPORT_NAME, pAccount.getAccount(), SOFTWARE_COMPLIANCE_SUMMARY_COLUMN_HEADERS, pPrintWriter); while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); } lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getSoftwareLparBaselineReport(Account pAccount, String remoteUser, String lsName, PrintWriter pPrintWriter) throws HibernateException, Exception { ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()) .createSQLQuery("SELECT SL.Name AS SL_Name" + ", SL.Bios_Serial" + ", COALESCE ( hle.Processor_Count,0)" + ", SL.ScanTime" + ", CASE LENGTH(RTRIM(COALESCE(CHAR(HSC.Id), ''))) WHEN 0 THEN 'No' ELSE 'Yes' END" + ", H.Serial" + ", MT.Name AS MT_Name" + ", MT.Type " + "FROM EAADMIN.Software_Lpar SL " + "LEFT OUTER JOIN EAADMIN.HW_SW_Composite HSC ON HSC.Software_Lpar_Id = SL.Id " + "LEFT OUTER JOIN EAADMIN.Hardware_Lpar HL ON HL.Id = HSC.Hardware_Lpar_Id " + "LEFT OUTER JOIN EAADMIN.Hardware H ON H.Id = HL.Hardware_Id " + "LEFT OUTER JOIN EAADMIN.Machine_Type MT ON MT.Id = H.Machine_Type_Id " + "LEFT OUTER JOIN EAADMIN.Hardware_lpar_eff hle on ( hle.hardware_lpar_id=hl.id and hle.status = 'ACTIVE' )" + " WHERE SL.Customer_Id = :customerId AND SL.Status = 'ACTIVE' " + " ORDER BY SL.Name ASC") .setLong("customerId", pAccount.getId()).scroll(ScrollMode.FORWARD_ONLY); printHeader(SOFTWARE_LPAR_BASELINE_REPORT_NAME, pAccount.getAccount(), SOFTWARE_LPAR_BASELINE_COLUMN_HEADERS, pPrintWriter); while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); }//from www .j av a 2 s. c o m lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getSoftwareVarianceReport(Account pAccount, String remoteUser, String lsName, PrintWriter pPrintWriter) throws HibernateException, Exception { ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery( "SELECT S.Software_Name, COUNT(IS.Software_Id), CAST(NULL AS VARCHAR(256)) FROM EAADMIN.Software S, EAADMIN.Installed_Software IS, EAADMIN.Software_Lpar SL WHERE S.Software_Id = IS.Software_Id AND S.Status = 'ACTIVE' AND S.Level = 'LICENSABLE' AND IS.Discrepancy_Type_Id IN (1, 2, 4) AND IS.Status = 'ACTIVE' AND IS.Software_Lpar_Id = SL.Id AND NOT EXISTS (SELECT SF.Software_Id FROM EAADMIN.Schedule_F SF, EAADMIN.Status S2 WHERE SF.Customer_Id = :customerId AND SF.Software_Name = S.Software_Name AND S2.Id = SF.Status_Id AND S2.Description = 'ACTIVE') AND SL.Customer_Id = :customerId GROUP BY S.Software_Name UNION SELECT SF.Software_Name, CAST(0 AS INTEGER), SF.Software_Title FROM EAADMIN.Schedule_F SF, EAADMIN.Status S2 WHERE SF.Customer_Id = :customerId AND S2.Id = SF.Status_Id AND S2.Description = 'ACTIVE' AND NOT EXISTS (SELECT S3.Software_Id FROM EAADMIN.Software S3, EAADMIN.Installed_Software IS, EAADMIN.Software_Lpar SL WHERE S3.Software_Name = SF.Software_Name AND S3.Software_Id = IS.Software_Id AND S3.Status = 'ACTIVE' AND S3.Level = 'LICENSABLE' AND IS.Discrepancy_Type_Id IN (1, 2, 4) AND IS.Status = 'ACTIVE' AND IS.Software_Lpar_Id = SL.Id AND SL.Customer_Id = :customerId) ORDER BY Software_Name") .setLong("customerId", pAccount.getId()).scroll(ScrollMode.FORWARD_ONLY); printHeader(SOFTWARE_VARIANCE_REPORT_NAME, null, SOFTWARE_VARIANCE_REPORT_COLUMN_HEADERS, pPrintWriter); while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); }//from ww w . ja va 2 s . com lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getWorkstationAccountsReport(String remoteUser, String lsName, PrintWriter pPrintWriter) throws HibernateException, Exception { ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery( "SELECT C.Account_Number, C.Customer_Name, CT.Customer_Type_Name, G.Name AS G_Name, R.Name AS R_Name, CC.Name AS CC_Name, S.Sector_Name, COUNT(H.Id), H.Hardware_Status FROM EAADMIN.Customer C, EAADMIN.Customer_Type CT, EAADMIN.Country_Code CC, EAADMIN.Region R, EAADMIN.Geography G, EAADMIN.Sector S, EAADMIN.Hardware H, EAADMIN.Machine_Type MT WHERE C.Status = 'ACTIVE' AND C.Customer_Type_Id = CT.Customer_Type_Id AND CT.Customer_Type_Name LIKE '%WORKSTATION%' AND G.Id = R.Geography_Id AND R.Id = CC.Region_Id AND CC.Id = C.Country_Code_Id AND S.Sector_Id = C.Sector_Id AND H.Customer_Id = C.Customer_Id AND H.Status = 'ACTIVE' AND MT.Id = H.Machine_Type_Id AND MT.Type != 'WORKSTATION' GROUP BY C.Account_Number, C.Customer_Name, CT.Customer_Type_Name, G.Name, R.Name, CC.Name, S.Sector_Name, H.Hardware_Status ORDER BY C.Account_Number, H.Hardware_Status") .scroll(ScrollMode.FORWARD_ONLY); printHeader(WORKSTATION_ACCOUNTS_REPORT_NAME, null, WORKSTATION_ACCOUNTS_REPORT_COLUMN_HEADERS, pPrintWriter);//from www . ja v a 2 s . c om while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); } lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Override @Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getPriorityISVSWReport(PrintWriter pPrintWriter) { printHeader(PRIORITY_ISV_SW_REPORT_NAME, null, PRIORITY_ISV_SW_REPORT_COLUMN_HEADERS, pPrintWriter); ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery( "SELECT mf.NAME, isv.LEVEL, case when isv.LEVEL = 'GLOBAL' then 'ALL' else cus.CUSTOMER_NAME end as CUSTOMER_NAME, cus.ACCOUNT_NUMBER, isv.EVIDENCE_LOCATION, st.DESCRIPTION, isv.BUSINESS_JUSTIFICATION,isv.REMOTE_USER, isv.RECORD_TIME from EAADMIN.PRIORITY_ISV_SW isv inner join EAADMIN.MANUFACTURER mf on isv.MANUFACTURER_ID = mf.ID inner join EAADMIN.STATUS st on isv.STATUS_ID = st.ID left outer join EAADMIN.CUSTOMER cus on isv.CUSTOMER_ID = cus.CUSTOMER_ID") .scroll(ScrollMode.FORWARD_ONLY); while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); }/*w w w . j a v a 2 s.c o m*/ lsrReport.close(); }
From source file:com.ibm.asset.trails.service.impl.ReportServiceImpl.java
License:Open Source License
@Transactional(readOnly = false, propagation = Propagation.NOT_SUPPORTED) public void getScheduleFReport(Account account, PrintWriter pPrintWriter) { StringBuffer sql = new StringBuffer(); sql.append(/*from w ww. j a v a 2 s. co m*/ "select sf.Level,sf.hw_Owner,sf.hostname,sf.serial,sf.Machine_Type, c.account_number,sf.software_title,sf.software_name,sf.manufacturer,sc.description as Scope,sf.sw_financial_resp,so.description as Source,sf.source_location,st.description as Status,sf.business_justification") .append(" from eaadmin.schedule_f sf,eaadmin.scope sc, eaadmin.status st,eaadmin.source so,eaadmin.customer c ") .append(" where sc.id=sf.scope_id and st.id=sf.status_id and so.id=sf.source_id and c.customer_id=sf.customer_id and") .append(" c.customer_id=").append(account.getId()); ScrollableResults lsrReport = ((Session) getEntityManager().getDelegate()).createSQLQuery(sql.toString()) .scroll(ScrollMode.FORWARD_ONLY); pPrintWriter.println(outputData(SCHEDULE_F_REPORT_COLUMN_HEADERS)); while (lsrReport.next()) { pPrintWriter.println(outputData(lsrReport.get())); } lsrReport.close(); }