@Test public void test() throws Exception, DataAccessException { when(rs.next()).thenReturn(true).thenReturn(false); when(rs.getString("rc_id")).thenReturn("6"); when(rs.getString("rc_regnno")).thenReturn("egov6"); when(rs.getString("rc_applicationnumber")).thenReturn("appl6"); when(rs.getString("rc_tenantid")).thenReturn("ap.kurnool"); when(rs.getString("rc_reissueapplstatus")).thenReturn(ApplicationStatus.APPROVED.toString()); when(rs.getString("rc_stateid")).thenReturn("state6"); when(rs.getLong("rc_demands")).thenReturn(Long.valueOf("7894561230")); when(rs.getString("rc_rejectionReason")).thenReturn("notrejected"); when(rs.getString("rc_remarks")).thenReturn("goodremark"); when(rs.getString("rc_isactive")).thenReturn("ACTIVE"); when(rs.getString("rc_applicantname")).thenReturn("user6"); when(rs.getString("rc_applicantaddress")).thenReturn("No.10 Dno.13 AKM, Outdoors, Bangalore"); when(rs.getString("rc_applicantmobileno")).thenReturn("9874563210"); when(rs.getBigDecimal("rc_applicantfee")).thenReturn(BigDecimal.valueOf(10.1)); when(rs.getString("rc_applicantaadhaar")).thenReturn("BXQD12GH"); when(rs.getString("rc_approvalaction")).thenReturn("APPROVED"); when(rs.getLong("rc_approvalassignee")).thenReturn(Long.valueOf("00020")); when(rs.getString("rc_approvalcomments")).thenReturn("NoCorrections"); when(rs.getLong("rc_approvaldepartment")).thenReturn(Long.valueOf("00020")); when(rs.getLong("rc_approvaldesignation")).thenReturn(Long.valueOf("20")); when(rs.getString("rc_approvalstatus")).thenReturn("ACTIVE"); when(rs.getString("rc_createdby")).thenReturn("user6"); when(rs.getLong("rc_createdtime")).thenReturn(Long.valueOf("9874563210")); when(rs.getString("rc_lastmodifiedby")).thenReturn("user6"); when(rs.getLong("rc_lastmodifiedtime")).thenReturn(Long.valueOf("9874563210")); when(rs.getString("ds_id")).thenReturn("6"); when(rs.getString("ds_documenttypecode")).thenReturn("00015"); when(rs.getString("ds_location")).thenReturn("Bangalore"); when(rs.getString("ds_reissuecertificateid")).thenReturn("15"); when(rs.getString("ds_tenantid")).thenReturn("ap.kurnool"); when(rs.getString("ds_createdby")).thenReturn("user2"); when(rs.getLong("ds_createdtime")).thenReturn(Long.valueOf("9874563210")); when(rs.getString("ds_lastmodifiedby")).thenReturn("user6"); when(rs.getLong("ds_lastmodifiedtime")).thenReturn(Long.valueOf("9874563210")); when(rs.getString("mc_certificateno")).thenReturn("00015"); when(rs.getLong("mc_certificatedate")).thenReturn(Long.valueOf("9874563210")); when(rs.getString("mc_certificatetype")).thenReturn(CertificateType.REGISTRATION.toString()); when(rs.getString("mc_regnnumber")).thenReturn("egov6"); when(rs.getString("mc_bridegroomphoto")).thenReturn("NotAvailable"); when(rs.getString("mc_bridephoto")).thenReturn("NotAvailable"); when(rs.getString("mc_husbandname")).thenReturn("user2"); when(rs.getString("mc_husbandaddress")).thenReturn("No.10 Dno13 AKM, Outdoors, Bangalore"); when(rs.getString("mc_wifename")).thenReturn("user6"); when(rs.getString("mc_wifeaddress")).thenReturn("No.10 Dno13 AKM, Outdoors, Bangalore"); when(rs.getLong("mc_marriagedate")).thenReturn(Long.valueOf("9632587410")); when(rs.getString("mc_marriagevenueaddress")).thenReturn("FUNCTIONHALL"); when(rs.getLong("mc_regndate")).thenReturn(Long.valueOf("1234567890")); when(rs.getString("mc_regnserialno")).thenReturn("6549873"); when(rs.getString("mc_regnvolumeno")).thenReturn("20"); when(rs.getString("mc_certificateplace")).thenReturn("Bangalore"); when(rs.getString("mc_templateversion")).thenReturn("2"); when(rs.getString("mc_applicationnumber")).thenReturn("egov6"); when(rs.getString("mc_tenantid")).thenReturn("ap.kurnool"); List<ReissueCertAppl> reissueCertAppls = marriageCertRowMapper.extractData(rs); assertEquals(getReissueCertAppl(), reissueCertAppls); }
@Override public List<ReissueCertAppl> extractData(ResultSet rs) throws SQLException, DataAccessException { Map<String, ReissueCertAppl> reissuecertmap = new HashMap<>(); while (rs.next()) { ReissueApplicantInfo reissueApplicantInfo = new ReissueApplicantInfo(); ApprovalDetails approvalDetails = new ApprovalDetails(); AuditDetails auditDetails = new AuditDetails(); MarriageDocument marriageDocument = new MarriageDocument(); MarriageCertificate marriageCertificate = new MarriageCertificate(); List<Long> demands = new ArrayList<>(); try { String reissueId = rs.getString("rc_id"); log.info("MarriagecertRowMapper reissueId;;" + reissueId); ReissueCertAppl reissueCertAppl = reissuecertmap.get(reissueId); if (reissueCertAppl == null) { reissueCertAppl = new ReissueCertAppl(); reissueCertAppl.setId(rs.getString("rc_id")); reissueCertAppl.setRegnNo(rs.getString("rc_regnno")); reissueCertAppl.setApplicationNumber(rs.getString("rc_applicationnumber")); reissueCertAppl.setTenantId(rs.getString("rc_tenantid")); reissueCertAppl .setReissueApplStatus(ApplicationStatus.fromValue(rs.getString("rc_reissueapplstatus"))); reissueCertAppl.setStateId(rs.getString("rc_stateid")); demands.add(rs.getLong("rc_demands")); reissueCertAppl.setDemands(demands); reissueCertAppl.setRejectionReason(rs.getString("rc_rejectionReason")); reissueCertAppl.setRemarks(rs.getString("rc_remarks")); reissueCertAppl.setIsActive(rs.getBoolean("rc_isactive")); reissueApplicantInfo.setName(rs.getString("rc_applicantname")); reissueApplicantInfo.setAddress(rs.getString("rc_applicantaddress")); reissueApplicantInfo.setMobileNo(rs.getString("rc_applicantmobileno")); reissueApplicantInfo.setFee(rs.getBigDecimal("rc_applicantfee")); reissueApplicantInfo.setAadhaar(rs.getString("rc_applicantaadhaar")); reissueCertAppl.setApplicantInfo(reissueApplicantInfo); approvalDetails.setAction(rs.getString("rc_approvalaction")); approvalDetails.setAssignee(rs.getLong("rc_approvalassignee")); approvalDetails.setComments(rs.getString("rc_approvalcomments")); approvalDetails.setDepartment(rs.getLong("rc_approvaldepartment")); approvalDetails.setDesignation(rs.getLong("rc_approvaldesignation")); approvalDetails.setStatus(rs.getString("rc_approvalstatus")); reissueCertAppl.setApprovalDetails(approvalDetails); auditDetails.setCreatedBy(rs.getString("rc_createdby")); auditDetails.setCreatedTime(rs.getLong("rc_createdtime")); auditDetails.setLastModifiedBy(rs.getString("rc_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("rc_lastmodifiedtime")); reissueCertAppl.setAuditDetails(auditDetails); reissueCertAppl.setDocuments(new ArrayList<>()); log.info("MarriagecertRowMapper reissueCertAppl;;;" + reissueCertAppl); reissuecertmap.put(reissueId, reissueCertAppl); log.info("MarriagecertRowMapper reissuecertmap;;;" + reissuecertmap); } marriageDocument.setId(rs.getString("ds_id")); marriageDocument.setDocumentType(rs.getString("ds_documenttypecode")); marriageDocument.setLocation(rs.getString("ds_location")); marriageDocument.setReissueCertificateId(rs.getString("ds_reissuecertificateid")); marriageDocument.setTenantId(rs.getString("ds_tenantid")); auditDetails.setCreatedBy(rs.getString("ds_createdby")); auditDetails.setCreatedTime(rs.getLong("ds_createdtime")); auditDetails.setLastModifiedBy(rs.getString("ds_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("ds_lastmodifiedtime")); marriageDocument.setAuditDetails(auditDetails); marriageCertificate.setCertificateNo(rs.getString("mc_certificateno")); marriageCertificate.setCertificateDate(rs.getLong("mc_certificatedate")); marriageCertificate.setCertificateType(CertificateType.fromValue(rs.getString("mc_certificatetype"))); marriageCertificate.setRegnNumber(rs.getString("mc_regnnumber")); marriageCertificate.setBridegroomPhoto(rs.getString("mc_bridegroomphoto")); marriageCertificate.setBridePhoto(rs.getString("mc_bridephoto")); marriageCertificate.setHusbandName(rs.getString("mc_husbandname")); marriageCertificate.setHusbandAddress(rs.getString("mc_husbandaddress")); marriageCertificate.setWifeName(rs.getString("mc_wifename")); marriageCertificate.setWifeAddress(rs.getString("mc_wifeaddress")); marriageCertificate.setMarriageDate(rs.getLong("mc_marriagedate")); marriageCertificate.setMarriageVenueAddress(rs.getString("mc_marriagevenueaddress")); marriageCertificate.setRegnDate(rs.getLong("mc_regndate")); marriageCertificate.setRegnSerialNo(rs.getString("mc_regnserialno")); marriageCertificate.setRegnVolumeNo(rs.getString("mc_regnvolumeno")); marriageCertificate.setCertificatePlace(rs.getString("mc_certificateplace")); marriageCertificate.setTemplateVersion(rs.getString("mc_templateversion")); marriageCertificate.setApplicationNumber(rs.getString("mc_applicationnumber")); marriageCertificate.setTenantId(rs.getString("mc_tenantid")); if (reissueCertAppl.getRegnNo().equals(marriageCertificate.getRegnNumber())) { reissueCertAppl.setCertificate(marriageCertificate); } if (reissueCertAppl.getId().equals(marriageDocument.getReissueCertificateId())) { reissueCertAppl.getDocuments().add(marriageDocument); } log.info("reissueCertAppl.getCertificates() " + marriageCertificate.getRegnNumber()); log.info("reissueCertAppl.getDocuments() " + reissueCertAppl.getDocuments()); } catch (Exception e) { log.info("exception in reissuecertificate : " + e); throw new RuntimeException("error while mapping object from result set : " + e); } } return new ArrayList<>(reissuecertmap.values()); }
MarriageCertRowMapper implements ResultSetExtractor<List<ReissueCertAppl>> { @Override public List<ReissueCertAppl> extractData(ResultSet rs) throws SQLException, DataAccessException { Map<String, ReissueCertAppl> reissuecertmap = new HashMap<>(); while (rs.next()) { ReissueApplicantInfo reissueApplicantInfo = new ReissueApplicantInfo(); ApprovalDetails approvalDetails = new ApprovalDetails(); AuditDetails auditDetails = new AuditDetails(); MarriageDocument marriageDocument = new MarriageDocument(); MarriageCertificate marriageCertificate = new MarriageCertificate(); List<Long> demands = new ArrayList<>(); try { String reissueId = rs.getString("rc_id"); log.info("MarriagecertRowMapper reissueId;;" + reissueId); ReissueCertAppl reissueCertAppl = reissuecertmap.get(reissueId); if (reissueCertAppl == null) { reissueCertAppl = new ReissueCertAppl(); reissueCertAppl.setId(rs.getString("rc_id")); reissueCertAppl.setRegnNo(rs.getString("rc_regnno")); reissueCertAppl.setApplicationNumber(rs.getString("rc_applicationnumber")); reissueCertAppl.setTenantId(rs.getString("rc_tenantid")); reissueCertAppl .setReissueApplStatus(ApplicationStatus.fromValue(rs.getString("rc_reissueapplstatus"))); reissueCertAppl.setStateId(rs.getString("rc_stateid")); demands.add(rs.getLong("rc_demands")); reissueCertAppl.setDemands(demands); reissueCertAppl.setRejectionReason(rs.getString("rc_rejectionReason")); reissueCertAppl.setRemarks(rs.getString("rc_remarks")); reissueCertAppl.setIsActive(rs.getBoolean("rc_isactive")); reissueApplicantInfo.setName(rs.getString("rc_applicantname")); reissueApplicantInfo.setAddress(rs.getString("rc_applicantaddress")); reissueApplicantInfo.setMobileNo(rs.getString("rc_applicantmobileno")); reissueApplicantInfo.setFee(rs.getBigDecimal("rc_applicantfee")); reissueApplicantInfo.setAadhaar(rs.getString("rc_applicantaadhaar")); reissueCertAppl.setApplicantInfo(reissueApplicantInfo); approvalDetails.setAction(rs.getString("rc_approvalaction")); approvalDetails.setAssignee(rs.getLong("rc_approvalassignee")); approvalDetails.setComments(rs.getString("rc_approvalcomments")); approvalDetails.setDepartment(rs.getLong("rc_approvaldepartment")); approvalDetails.setDesignation(rs.getLong("rc_approvaldesignation")); approvalDetails.setStatus(rs.getString("rc_approvalstatus")); reissueCertAppl.setApprovalDetails(approvalDetails); auditDetails.setCreatedBy(rs.getString("rc_createdby")); auditDetails.setCreatedTime(rs.getLong("rc_createdtime")); auditDetails.setLastModifiedBy(rs.getString("rc_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("rc_lastmodifiedtime")); reissueCertAppl.setAuditDetails(auditDetails); reissueCertAppl.setDocuments(new ArrayList<>()); log.info("MarriagecertRowMapper reissueCertAppl;;;" + reissueCertAppl); reissuecertmap.put(reissueId, reissueCertAppl); log.info("MarriagecertRowMapper reissuecertmap;;;" + reissuecertmap); } marriageDocument.setId(rs.getString("ds_id")); marriageDocument.setDocumentType(rs.getString("ds_documenttypecode")); marriageDocument.setLocation(rs.getString("ds_location")); marriageDocument.setReissueCertificateId(rs.getString("ds_reissuecertificateid")); marriageDocument.setTenantId(rs.getString("ds_tenantid")); auditDetails.setCreatedBy(rs.getString("ds_createdby")); auditDetails.setCreatedTime(rs.getLong("ds_createdtime")); auditDetails.setLastModifiedBy(rs.getString("ds_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("ds_lastmodifiedtime")); marriageDocument.setAuditDetails(auditDetails); marriageCertificate.setCertificateNo(rs.getString("mc_certificateno")); marriageCertificate.setCertificateDate(rs.getLong("mc_certificatedate")); marriageCertificate.setCertificateType(CertificateType.fromValue(rs.getString("mc_certificatetype"))); marriageCertificate.setRegnNumber(rs.getString("mc_regnnumber")); marriageCertificate.setBridegroomPhoto(rs.getString("mc_bridegroomphoto")); marriageCertificate.setBridePhoto(rs.getString("mc_bridephoto")); marriageCertificate.setHusbandName(rs.getString("mc_husbandname")); marriageCertificate.setHusbandAddress(rs.getString("mc_husbandaddress")); marriageCertificate.setWifeName(rs.getString("mc_wifename")); marriageCertificate.setWifeAddress(rs.getString("mc_wifeaddress")); marriageCertificate.setMarriageDate(rs.getLong("mc_marriagedate")); marriageCertificate.setMarriageVenueAddress(rs.getString("mc_marriagevenueaddress")); marriageCertificate.setRegnDate(rs.getLong("mc_regndate")); marriageCertificate.setRegnSerialNo(rs.getString("mc_regnserialno")); marriageCertificate.setRegnVolumeNo(rs.getString("mc_regnvolumeno")); marriageCertificate.setCertificatePlace(rs.getString("mc_certificateplace")); marriageCertificate.setTemplateVersion(rs.getString("mc_templateversion")); marriageCertificate.setApplicationNumber(rs.getString("mc_applicationnumber")); marriageCertificate.setTenantId(rs.getString("mc_tenantid")); if (reissueCertAppl.getRegnNo().equals(marriageCertificate.getRegnNumber())) { reissueCertAppl.setCertificate(marriageCertificate); } if (reissueCertAppl.getId().equals(marriageDocument.getReissueCertificateId())) { reissueCertAppl.getDocuments().add(marriageDocument); } log.info("reissueCertAppl.getCertificates() " + marriageCertificate.getRegnNumber()); log.info("reissueCertAppl.getDocuments() " + reissueCertAppl.getDocuments()); } catch (Exception e) { log.info("exception in reissuecertificate : " + e); throw new RuntimeException("error while mapping object from result set : " + e); } } return new ArrayList<>(reissuecertmap.values()); } }
MarriageCertRowMapper implements ResultSetExtractor<List<ReissueCertAppl>> { @Override public List<ReissueCertAppl> extractData(ResultSet rs) throws SQLException, DataAccessException { Map<String, ReissueCertAppl> reissuecertmap = new HashMap<>(); while (rs.next()) { ReissueApplicantInfo reissueApplicantInfo = new ReissueApplicantInfo(); ApprovalDetails approvalDetails = new ApprovalDetails(); AuditDetails auditDetails = new AuditDetails(); MarriageDocument marriageDocument = new MarriageDocument(); MarriageCertificate marriageCertificate = new MarriageCertificate(); List<Long> demands = new ArrayList<>(); try { String reissueId = rs.getString("rc_id"); log.info("MarriagecertRowMapper reissueId;;" + reissueId); ReissueCertAppl reissueCertAppl = reissuecertmap.get(reissueId); if (reissueCertAppl == null) { reissueCertAppl = new ReissueCertAppl(); reissueCertAppl.setId(rs.getString("rc_id")); reissueCertAppl.setRegnNo(rs.getString("rc_regnno")); reissueCertAppl.setApplicationNumber(rs.getString("rc_applicationnumber")); reissueCertAppl.setTenantId(rs.getString("rc_tenantid")); reissueCertAppl .setReissueApplStatus(ApplicationStatus.fromValue(rs.getString("rc_reissueapplstatus"))); reissueCertAppl.setStateId(rs.getString("rc_stateid")); demands.add(rs.getLong("rc_demands")); reissueCertAppl.setDemands(demands); reissueCertAppl.setRejectionReason(rs.getString("rc_rejectionReason")); reissueCertAppl.setRemarks(rs.getString("rc_remarks")); reissueCertAppl.setIsActive(rs.getBoolean("rc_isactive")); reissueApplicantInfo.setName(rs.getString("rc_applicantname")); reissueApplicantInfo.setAddress(rs.getString("rc_applicantaddress")); reissueApplicantInfo.setMobileNo(rs.getString("rc_applicantmobileno")); reissueApplicantInfo.setFee(rs.getBigDecimal("rc_applicantfee")); reissueApplicantInfo.setAadhaar(rs.getString("rc_applicantaadhaar")); reissueCertAppl.setApplicantInfo(reissueApplicantInfo); approvalDetails.setAction(rs.getString("rc_approvalaction")); approvalDetails.setAssignee(rs.getLong("rc_approvalassignee")); approvalDetails.setComments(rs.getString("rc_approvalcomments")); approvalDetails.setDepartment(rs.getLong("rc_approvaldepartment")); approvalDetails.setDesignation(rs.getLong("rc_approvaldesignation")); approvalDetails.setStatus(rs.getString("rc_approvalstatus")); reissueCertAppl.setApprovalDetails(approvalDetails); auditDetails.setCreatedBy(rs.getString("rc_createdby")); auditDetails.setCreatedTime(rs.getLong("rc_createdtime")); auditDetails.setLastModifiedBy(rs.getString("rc_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("rc_lastmodifiedtime")); reissueCertAppl.setAuditDetails(auditDetails); reissueCertAppl.setDocuments(new ArrayList<>()); log.info("MarriagecertRowMapper reissueCertAppl;;;" + reissueCertAppl); reissuecertmap.put(reissueId, reissueCertAppl); log.info("MarriagecertRowMapper reissuecertmap;;;" + reissuecertmap); } marriageDocument.setId(rs.getString("ds_id")); marriageDocument.setDocumentType(rs.getString("ds_documenttypecode")); marriageDocument.setLocation(rs.getString("ds_location")); marriageDocument.setReissueCertificateId(rs.getString("ds_reissuecertificateid")); marriageDocument.setTenantId(rs.getString("ds_tenantid")); auditDetails.setCreatedBy(rs.getString("ds_createdby")); auditDetails.setCreatedTime(rs.getLong("ds_createdtime")); auditDetails.setLastModifiedBy(rs.getString("ds_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("ds_lastmodifiedtime")); marriageDocument.setAuditDetails(auditDetails); marriageCertificate.setCertificateNo(rs.getString("mc_certificateno")); marriageCertificate.setCertificateDate(rs.getLong("mc_certificatedate")); marriageCertificate.setCertificateType(CertificateType.fromValue(rs.getString("mc_certificatetype"))); marriageCertificate.setRegnNumber(rs.getString("mc_regnnumber")); marriageCertificate.setBridegroomPhoto(rs.getString("mc_bridegroomphoto")); marriageCertificate.setBridePhoto(rs.getString("mc_bridephoto")); marriageCertificate.setHusbandName(rs.getString("mc_husbandname")); marriageCertificate.setHusbandAddress(rs.getString("mc_husbandaddress")); marriageCertificate.setWifeName(rs.getString("mc_wifename")); marriageCertificate.setWifeAddress(rs.getString("mc_wifeaddress")); marriageCertificate.setMarriageDate(rs.getLong("mc_marriagedate")); marriageCertificate.setMarriageVenueAddress(rs.getString("mc_marriagevenueaddress")); marriageCertificate.setRegnDate(rs.getLong("mc_regndate")); marriageCertificate.setRegnSerialNo(rs.getString("mc_regnserialno")); marriageCertificate.setRegnVolumeNo(rs.getString("mc_regnvolumeno")); marriageCertificate.setCertificatePlace(rs.getString("mc_certificateplace")); marriageCertificate.setTemplateVersion(rs.getString("mc_templateversion")); marriageCertificate.setApplicationNumber(rs.getString("mc_applicationnumber")); marriageCertificate.setTenantId(rs.getString("mc_tenantid")); if (reissueCertAppl.getRegnNo().equals(marriageCertificate.getRegnNumber())) { reissueCertAppl.setCertificate(marriageCertificate); } if (reissueCertAppl.getId().equals(marriageDocument.getReissueCertificateId())) { reissueCertAppl.getDocuments().add(marriageDocument); } log.info("reissueCertAppl.getCertificates() " + marriageCertificate.getRegnNumber()); log.info("reissueCertAppl.getDocuments() " + reissueCertAppl.getDocuments()); } catch (Exception e) { log.info("exception in reissuecertificate : " + e); throw new RuntimeException("error while mapping object from result set : " + e); } } return new ArrayList<>(reissuecertmap.values()); }  }
MarriageCertRowMapper implements ResultSetExtractor<List<ReissueCertAppl>> { @Override public List<ReissueCertAppl> extractData(ResultSet rs) throws SQLException, DataAccessException { Map<String, ReissueCertAppl> reissuecertmap = new HashMap<>(); while (rs.next()) { ReissueApplicantInfo reissueApplicantInfo = new ReissueApplicantInfo(); ApprovalDetails approvalDetails = new ApprovalDetails(); AuditDetails auditDetails = new AuditDetails(); MarriageDocument marriageDocument = new MarriageDocument(); MarriageCertificate marriageCertificate = new MarriageCertificate(); List<Long> demands = new ArrayList<>(); try { String reissueId = rs.getString("rc_id"); log.info("MarriagecertRowMapper reissueId;;" + reissueId); ReissueCertAppl reissueCertAppl = reissuecertmap.get(reissueId); if (reissueCertAppl == null) { reissueCertAppl = new ReissueCertAppl(); reissueCertAppl.setId(rs.getString("rc_id")); reissueCertAppl.setRegnNo(rs.getString("rc_regnno")); reissueCertAppl.setApplicationNumber(rs.getString("rc_applicationnumber")); reissueCertAppl.setTenantId(rs.getString("rc_tenantid")); reissueCertAppl .setReissueApplStatus(ApplicationStatus.fromValue(rs.getString("rc_reissueapplstatus"))); reissueCertAppl.setStateId(rs.getString("rc_stateid")); demands.add(rs.getLong("rc_demands")); reissueCertAppl.setDemands(demands); reissueCertAppl.setRejectionReason(rs.getString("rc_rejectionReason")); reissueCertAppl.setRemarks(rs.getString("rc_remarks")); reissueCertAppl.setIsActive(rs.getBoolean("rc_isactive")); reissueApplicantInfo.setName(rs.getString("rc_applicantname")); reissueApplicantInfo.setAddress(rs.getString("rc_applicantaddress")); reissueApplicantInfo.setMobileNo(rs.getString("rc_applicantmobileno")); reissueApplicantInfo.setFee(rs.getBigDecimal("rc_applicantfee")); reissueApplicantInfo.setAadhaar(rs.getString("rc_applicantaadhaar")); reissueCertAppl.setApplicantInfo(reissueApplicantInfo); approvalDetails.setAction(rs.getString("rc_approvalaction")); approvalDetails.setAssignee(rs.getLong("rc_approvalassignee")); approvalDetails.setComments(rs.getString("rc_approvalcomments")); approvalDetails.setDepartment(rs.getLong("rc_approvaldepartment")); approvalDetails.setDesignation(rs.getLong("rc_approvaldesignation")); approvalDetails.setStatus(rs.getString("rc_approvalstatus")); reissueCertAppl.setApprovalDetails(approvalDetails); auditDetails.setCreatedBy(rs.getString("rc_createdby")); auditDetails.setCreatedTime(rs.getLong("rc_createdtime")); auditDetails.setLastModifiedBy(rs.getString("rc_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("rc_lastmodifiedtime")); reissueCertAppl.setAuditDetails(auditDetails); reissueCertAppl.setDocuments(new ArrayList<>()); log.info("MarriagecertRowMapper reissueCertAppl;;;" + reissueCertAppl); reissuecertmap.put(reissueId, reissueCertAppl); log.info("MarriagecertRowMapper reissuecertmap;;;" + reissuecertmap); } marriageDocument.setId(rs.getString("ds_id")); marriageDocument.setDocumentType(rs.getString("ds_documenttypecode")); marriageDocument.setLocation(rs.getString("ds_location")); marriageDocument.setReissueCertificateId(rs.getString("ds_reissuecertificateid")); marriageDocument.setTenantId(rs.getString("ds_tenantid")); auditDetails.setCreatedBy(rs.getString("ds_createdby")); auditDetails.setCreatedTime(rs.getLong("ds_createdtime")); auditDetails.setLastModifiedBy(rs.getString("ds_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("ds_lastmodifiedtime")); marriageDocument.setAuditDetails(auditDetails); marriageCertificate.setCertificateNo(rs.getString("mc_certificateno")); marriageCertificate.setCertificateDate(rs.getLong("mc_certificatedate")); marriageCertificate.setCertificateType(CertificateType.fromValue(rs.getString("mc_certificatetype"))); marriageCertificate.setRegnNumber(rs.getString("mc_regnnumber")); marriageCertificate.setBridegroomPhoto(rs.getString("mc_bridegroomphoto")); marriageCertificate.setBridePhoto(rs.getString("mc_bridephoto")); marriageCertificate.setHusbandName(rs.getString("mc_husbandname")); marriageCertificate.setHusbandAddress(rs.getString("mc_husbandaddress")); marriageCertificate.setWifeName(rs.getString("mc_wifename")); marriageCertificate.setWifeAddress(rs.getString("mc_wifeaddress")); marriageCertificate.setMarriageDate(rs.getLong("mc_marriagedate")); marriageCertificate.setMarriageVenueAddress(rs.getString("mc_marriagevenueaddress")); marriageCertificate.setRegnDate(rs.getLong("mc_regndate")); marriageCertificate.setRegnSerialNo(rs.getString("mc_regnserialno")); marriageCertificate.setRegnVolumeNo(rs.getString("mc_regnvolumeno")); marriageCertificate.setCertificatePlace(rs.getString("mc_certificateplace")); marriageCertificate.setTemplateVersion(rs.getString("mc_templateversion")); marriageCertificate.setApplicationNumber(rs.getString("mc_applicationnumber")); marriageCertificate.setTenantId(rs.getString("mc_tenantid")); if (reissueCertAppl.getRegnNo().equals(marriageCertificate.getRegnNumber())) { reissueCertAppl.setCertificate(marriageCertificate); } if (reissueCertAppl.getId().equals(marriageDocument.getReissueCertificateId())) { reissueCertAppl.getDocuments().add(marriageDocument); } log.info("reissueCertAppl.getCertificates() " + marriageCertificate.getRegnNumber()); log.info("reissueCertAppl.getDocuments() " + reissueCertAppl.getDocuments()); } catch (Exception e) { log.info("exception in reissuecertificate : " + e); throw new RuntimeException("error while mapping object from result set : " + e); } } return new ArrayList<>(reissuecertmap.values()); }  @Override List<ReissueCertAppl> extractData(ResultSet rs); }
MarriageCertRowMapper implements ResultSetExtractor<List<ReissueCertAppl>> { @Override public List<ReissueCertAppl> extractData(ResultSet rs) throws SQLException, DataAccessException { Map<String, ReissueCertAppl> reissuecertmap = new HashMap<>(); while (rs.next()) { ReissueApplicantInfo reissueApplicantInfo = new ReissueApplicantInfo(); ApprovalDetails approvalDetails = new ApprovalDetails(); AuditDetails auditDetails = new AuditDetails(); MarriageDocument marriageDocument = new MarriageDocument(); MarriageCertificate marriageCertificate = new MarriageCertificate(); List<Long> demands = new ArrayList<>(); try { String reissueId = rs.getString("rc_id"); log.info("MarriagecertRowMapper reissueId;;" + reissueId); ReissueCertAppl reissueCertAppl = reissuecertmap.get(reissueId); if (reissueCertAppl == null) { reissueCertAppl = new ReissueCertAppl(); reissueCertAppl.setId(rs.getString("rc_id")); reissueCertAppl.setRegnNo(rs.getString("rc_regnno")); reissueCertAppl.setApplicationNumber(rs.getString("rc_applicationnumber")); reissueCertAppl.setTenantId(rs.getString("rc_tenantid")); reissueCertAppl .setReissueApplStatus(ApplicationStatus.fromValue(rs.getString("rc_reissueapplstatus"))); reissueCertAppl.setStateId(rs.getString("rc_stateid")); demands.add(rs.getLong("rc_demands")); reissueCertAppl.setDemands(demands); reissueCertAppl.setRejectionReason(rs.getString("rc_rejectionReason")); reissueCertAppl.setRemarks(rs.getString("rc_remarks")); reissueCertAppl.setIsActive(rs.getBoolean("rc_isactive")); reissueApplicantInfo.setName(rs.getString("rc_applicantname")); reissueApplicantInfo.setAddress(rs.getString("rc_applicantaddress")); reissueApplicantInfo.setMobileNo(rs.getString("rc_applicantmobileno")); reissueApplicantInfo.setFee(rs.getBigDecimal("rc_applicantfee")); reissueApplicantInfo.setAadhaar(rs.getString("rc_applicantaadhaar")); reissueCertAppl.setApplicantInfo(reissueApplicantInfo); approvalDetails.setAction(rs.getString("rc_approvalaction")); approvalDetails.setAssignee(rs.getLong("rc_approvalassignee")); approvalDetails.setComments(rs.getString("rc_approvalcomments")); approvalDetails.setDepartment(rs.getLong("rc_approvaldepartment")); approvalDetails.setDesignation(rs.getLong("rc_approvaldesignation")); approvalDetails.setStatus(rs.getString("rc_approvalstatus")); reissueCertAppl.setApprovalDetails(approvalDetails); auditDetails.setCreatedBy(rs.getString("rc_createdby")); auditDetails.setCreatedTime(rs.getLong("rc_createdtime")); auditDetails.setLastModifiedBy(rs.getString("rc_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("rc_lastmodifiedtime")); reissueCertAppl.setAuditDetails(auditDetails); reissueCertAppl.setDocuments(new ArrayList<>()); log.info("MarriagecertRowMapper reissueCertAppl;;;" + reissueCertAppl); reissuecertmap.put(reissueId, reissueCertAppl); log.info("MarriagecertRowMapper reissuecertmap;;;" + reissuecertmap); } marriageDocument.setId(rs.getString("ds_id")); marriageDocument.setDocumentType(rs.getString("ds_documenttypecode")); marriageDocument.setLocation(rs.getString("ds_location")); marriageDocument.setReissueCertificateId(rs.getString("ds_reissuecertificateid")); marriageDocument.setTenantId(rs.getString("ds_tenantid")); auditDetails.setCreatedBy(rs.getString("ds_createdby")); auditDetails.setCreatedTime(rs.getLong("ds_createdtime")); auditDetails.setLastModifiedBy(rs.getString("ds_lastmodifiedby")); auditDetails.setLastModifiedTime(rs.getLong("ds_lastmodifiedtime")); marriageDocument.setAuditDetails(auditDetails); marriageCertificate.setCertificateNo(rs.getString("mc_certificateno")); marriageCertificate.setCertificateDate(rs.getLong("mc_certificatedate")); marriageCertificate.setCertificateType(CertificateType.fromValue(rs.getString("mc_certificatetype"))); marriageCertificate.setRegnNumber(rs.getString("mc_regnnumber")); marriageCertificate.setBridegroomPhoto(rs.getString("mc_bridegroomphoto")); marriageCertificate.setBridePhoto(rs.getString("mc_bridephoto")); marriageCertificate.setHusbandName(rs.getString("mc_husbandname")); marriageCertificate.setHusbandAddress(rs.getString("mc_husbandaddress")); marriageCertificate.setWifeName(rs.getString("mc_wifename")); marriageCertificate.setWifeAddress(rs.getString("mc_wifeaddress")); marriageCertificate.setMarriageDate(rs.getLong("mc_marriagedate")); marriageCertificate.setMarriageVenueAddress(rs.getString("mc_marriagevenueaddress")); marriageCertificate.setRegnDate(rs.getLong("mc_regndate")); marriageCertificate.setRegnSerialNo(rs.getString("mc_regnserialno")); marriageCertificate.setRegnVolumeNo(rs.getString("mc_regnvolumeno")); marriageCertificate.setCertificatePlace(rs.getString("mc_certificateplace")); marriageCertificate.setTemplateVersion(rs.getString("mc_templateversion")); marriageCertificate.setApplicationNumber(rs.getString("mc_applicationnumber")); marriageCertificate.setTenantId(rs.getString("mc_tenantid")); if (reissueCertAppl.getRegnNo().equals(marriageCertificate.getRegnNumber())) { reissueCertAppl.setCertificate(marriageCertificate); } if (reissueCertAppl.getId().equals(marriageDocument.getReissueCertificateId())) { reissueCertAppl.getDocuments().add(marriageDocument); } log.info("reissueCertAppl.getCertificates() " + marriageCertificate.getRegnNumber()); log.info("reissueCertAppl.getDocuments() " + reissueCertAppl.getDocuments()); } catch (Exception e) { log.info("exception in reissuecertificate : " + e); throw new RuntimeException("error while mapping object from result set : " + e); } } return new ArrayList<>(reissuecertmap.values()); }  @Override List<ReissueCertAppl> extractData(ResultSet rs);  }