private Enforcement createEa( String eaCode, String eaStatus, HashMap<String, Object> processorHashmap, Conviction[] allOffenses) throws Exception { Applicant app = (Applicant) processorHashmap.get("applicant"); Conviction conv = (Conviction) processorHashmap.get("conviction"); String suspensionPeriod = (String) processorHashmap.get("suspensionPeriod"); Enforcement tempNewEA = new Enforcement(); tempNewEA.setApplicant(app); tempNewEA.setEnfActionCode(eaCode); setDates(tempNewEA, suspensionPeriod); tempNewEA.setStatus(eaStatus); if (conv != null) { if (tempNewEA.getConvictions() == null) { tempNewEA.setConvictions(new HashSet<Object>()); } tempNewEA.getConvictions().add(conv); tempNewEA.getConvictions().addAll(Arrays.asList(allOffenses)); } // Save the new enforcement try { eaDao.save(tempNewEA); } catch (DataAccessException e) { throw getBaseExceptionType( "DB Error: Failure to save new enforcement " + " for applicant (SSN : " + app.getSsn() + " )", e, logger, LOG_DEBUG); } return tempNewEA; }