@RequestMapping(value={"/",""},method=RequestMethod.POST) @ResponseBody public RestWrapper update(@ModelAttribute("execstatus") @Valid ExecStatus execStatus,BindingResult bindingResult,Principal principal){
  RestWrapper restWrapper=null;
  if (bindingResult.hasErrors()) {
    BindingResultError bindingResultError=new BindingResultError();
    return bindingResultError.errorMessage(bindingResult);
  }
  try {
    com.wipro.ats.bdre.md.dao.jpa.ExecStatus jpaExecStatus=new com.wipro.ats.bdre.md.dao.jpa.ExecStatus();
    jpaExecStatus.setExecStateId(execStatus.getExecStateId());
    jpaExecStatus.setDescription(execStatus.getDescription());
    execStatusDAO.update(jpaExecStatus);
    restWrapper=new RestWrapper(execStatus,RestWrapper.OK);
    LOGGER.info("Record with ID:" + execStatus.getExecStateId() + " updated in ExecStatus by User:"+ principal.getName()+ execStatus);
  }
 catch (  MetadataException e) {
    LOGGER.error(e);
    restWrapper=new RestWrapper(e.getMessage(),RestWrapper.ERROR);
  }
  return restWrapper;
}

@ RequestMapping ( value = { "/" , "" } , method = RequestMethod . POST ) @ ResponseBody public RestWrapper update ( @ ModelAttribute ( "execstatus" ) @ Valid ExecStatus execStatus , BindingResult bindingResult , Principal principal ) { RestWrapper restWrapper = null ; if ( bindingResult . hasErrors ( ) ) { BindingResultError bindingResultError = new BindingResultError ( ) ; return bindingResultError . errorMessage ( bindingResult ) ; } try { com . wipro . ats . bdre . md . dao . jpa . ExecStatus jpaExecStatus = new com . wipro . ats . bdre . md . dao . jpa . ExecStatus ( ) ; jpaExecStatus . setExecStateId ( execStatus . getExecStateId ( ) ) ; jpaExecStatus . setDescription ( execStatus . getDescription ( ) ) ; execStatusDAO . update ( jpaExecStatus ) ; restWrapper = new RestWrapper ( execStatus , RestWrapper . OK ) ; LOGGER . info ( "Record with ID:" + execStatus . getExecStateId ( ) + " updated in ExecStatus by User:" + principal . getName ( ) + execStatus ) ; } catch ( MetadataException e ) { LOGGER . error ( e ) ; restWrapper = new RestWrapper ( e . getMessage ( ) , RestWrapper . ERROR ) ; } return restWrapper ; }
this method calls proc updateexecstatus and updates the values passed . it also validates the values passed .
