@RequestMapping(value={"/",""},method=RequestMethod.PUT) @ResponseBody public RestWrapper insert(@ModelAttribute("adqstatus") @Valid AppDeploymentQueueStatus adqStatus,BindingResult bindingResult,Principal principal){
  LOGGER.debug("Entering into insert for adq_status table");
  RestWrapper restWrapper=null;
  if (bindingResult.hasErrors()) {
    BindingResultError bindingResultError=new BindingResultError();
    return bindingResultError.errorMessage(bindingResult);
  }
  try {
    com.wipro.ats.bdre.md.dao.jpa.AppDeploymentQueueStatus jpaAdqStatus=new com.wipro.ats.bdre.md.dao.jpa.AppDeploymentQueueStatus();
    jpaAdqStatus.setAppDeploymentStatusId(adqStatus.getAppDeploymentStatusId());
    jpaAdqStatus.setDescription(adqStatus.getDescription());
    Short appDeploymentStatusId=appDeploymentQueueStatusDAO.insert(jpaAdqStatus);
    adqStatus.setAppDeploymentStatusId(appDeploymentStatusId);
    LOGGER.debug("Exiting from insert for adq_status table");
    restWrapper=new RestWrapper(adqStatus,RestWrapper.OK);
    LOGGER.info(RECORDWITHID + " inserted in AppDeploymentQueueStatus by User:" + principal.getName()+ adqStatus);
  }
 catch (  Exception e) {
    LOGGER.error(e);
    return new RestWrapper(e.getMessage(),RestWrapper.ERROR);
  }
  return restWrapper;
}

@ RequestMapping ( value = { "/" , "" } , method = RequestMethod . PUT ) @ ResponseBody public RestWrapper insert ( @ ModelAttribute ( "adqstatus" ) @ Valid AppDeploymentQueueStatus adqStatus , BindingResult bindingResult , Principal principal ) { LOGGER . debug ( "Entering into insert for adq_status table" ) ; RestWrapper restWrapper = null ; if ( bindingResult . hasErrors ( ) ) { BindingResultError bindingResultError = new BindingResultError ( ) ; return bindingResultError . errorMessage ( bindingResult ) ; } try { com . wipro . ats . bdre . md . dao . jpa . AppDeploymentQueueStatus jpaAdqStatus = new com . wipro . ats . bdre . md . dao . jpa . AppDeploymentQueueStatus ( ) ; jpaAdqStatus . setAppDeploymentStatusId ( adqStatus . getAppDeploymentStatusId ( ) ) ; jpaAdqStatus . setDescription ( adqStatus . getDescription ( ) ) ; Short appDeploymentStatusId = appDeploymentQueueStatusDAO . insert ( jpaAdqStatus ) ; adqStatus . setAppDeploymentStatusId ( appDeploymentStatusId ) ; LOGGER . debug ( "Exiting from insert for adq_status table" ) ; restWrapper = new RestWrapper ( adqStatus , RestWrapper . OK ) ; LOGGER . info ( RECORDWITHID + " inserted in AppDeploymentQueueStatus by User:" + principal . getName ( ) + adqStatus ) ; } catch ( Exception e ) { LOGGER . error ( e ) ; return new RestWrapper ( e . getMessage ( ) , RestWrapper . ERROR ) ; } return restWrapper ; }
this method calls proc insertdeploystatus and adds a new record in the database . it also validates the values passed .
