List of usage examples for org.springframework.validation BindException getCause
public synchronized Throwable getCause()
From source file:org.openmrs.module.kenyaemr.fragment.controller.developer.DeveloperUtilsFragmentController.java
/** * Validate patient records//from w w w . ja v a 2 s . c o m */ @AppAction(EmrConstants.APP_DEVELOPER) public List<SimpleObject> validatePatients(UiUtils ui) { List<SimpleObject> problems = new ArrayList<SimpleObject>(); for (Patient patient : Context.getPatientService().getAllPatients()) { BindException errors = new BindException(patient, ""); Context.getAdministrationService().validate(patient, errors); if (errors.hasErrors()) { SimpleObject problem = new SimpleObject(); problem.put("patient", ui.simplifyObject(patient)); problem.put("errors", uniqueErrorMessages(errors)); problem.put("cause", errors.getCause()); problems.add(problem); } } return problems; }