Posts

Showing posts from April 25, 2012

Ibatis

Use if for each loop for iteration in MyBatis



public List<CaseDetail> getCasesFromSalesChecks(List<String> lstSalesCheck,String dcNo) throws CustDirectException {

Map<String, Object> mapSalesCheck= new HashMap<String, Object>();
mapSalesCheck.put("lstSalesCheck", lstSalesCheck);
mapSalesCheck.put("dcNo", dcNo);
List<CaseDetail> lstCases =caseDetailMapper.getCasesFromSalesChecks(mapSalesCheck);
if((null!=lstCases)&&(lstCases.size()!=0)){
logger.info("successfully found "+lstCases.size() +" cases for DC NO "+dcNo+ "  salescheck   " +lstSalesCheck.toString());
return lstCases;
}
logger.info("Fetching salescheck failed for " + lstSalesCheck);
throw new CustDirectException("error.dccust.reprinting.caseList.notFound");
}


public List<CaseDetail> getCasesFromSalesChecks(Map<String, Object> mapSalesCheck);

<select id="getCasesFromSalesChecks" resultType="com.sears.dc.c…