@RequestMapping(value={"/{cg}/{key}","/{cg}/{key}/"},method=RequestMethod.DELETE) @ResponseBody public RestWrapper delete(@PathVariable("cg") String configGroup,@PathVariable("key") String key,Principal principal){
  RestWrapper restWrapper=null;
  try {
    GeneralConfig generalConfig=new GeneralConfig();
    generalConfig.setConfigGroup(configGroup);
    generalConfig.setKey(key);
    GeneralConfigId jpaGeneralConfigId=new GeneralConfigId();
    jpaGeneralConfigId.setConfigGroup(generalConfig.getConfigGroup());
    jpaGeneralConfigId.setGcKey(generalConfig.getKey());
    generalConfigDAO.delete(jpaGeneralConfigId);
    restWrapper=new RestWrapper(null,RestWrapper.OK);
    LOGGER.info("Record with key:" + key + " deleted from general_config by User:"+ principal.getName());
  }
 catch (  MetadataException e) {
    LOGGER.error(e);
    restWrapper=new RestWrapper(e.getMessage(),RestWrapper.ERROR);
  }
  return restWrapper;
}

@ RequestMapping ( value = { "/{cg}/{key}" , "/{cg}/{key}/" } , method = RequestMethod . DELETE ) @ ResponseBody public RestWrapper delete ( @ PathVariable ( "cg" ) String configGroup , @ PathVariable ( "key" ) String key , Principal principal ) { RestWrapper restWrapper = null ; try { GeneralConfig generalConfig = new GeneralConfig ( ) ; generalConfig . setConfigGroup ( configGroup ) ; generalConfig . setKey ( key ) ; GeneralConfigId jpaGeneralConfigId = new GeneralConfigId ( ) ; jpaGeneralConfigId . setConfigGroup ( generalConfig . getConfigGroup ( ) ) ; jpaGeneralConfigId . setGcKey ( generalConfig . getKey ( ) ) ; generalConfigDAO . delete ( jpaGeneralConfigId ) ; restWrapper = new RestWrapper ( null , RestWrapper . OK ) ; LOGGER . info ( "Record with key:" + key + " deleted from general_config by User:" + principal . getName ( ) ) ; } catch ( MetadataException e ) { LOGGER . error ( e ) ; restWrapper = new RestWrapper ( e . getMessage ( ) , RestWrapper . ERROR ) ; } return restWrapper ; }
this method calls proc deletegeneralconfig and deletes a record in generalconfig table corresponding to config group and key passed .
