@RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
    public ResponseEntity<E> delete(@PathVariable int id) {

        try {
            E entityToDelete = this.service.findById(id);

            this.service.delete(entityToDelete);

            // extract the original classname from the name of the proxy, which
            // also contains _$$_ and some kind of hash after the original
            // classname
            final String proxyClassName = entityToDelete.getClass().getSimpleName();
            final String simpleClassName = StringUtils.substringBefore(proxyClassName, "_$$_");

            LOG.trace("Deleted " + simpleClassName + " with ID " + id);
            return new ResponseEntity<E>(HttpStatus.NO_CONTENT);
        } catch (Exception e) {
            LOG.error("Error deleting entity with ID " + id + ": "
                + e.getMessage());
            return new ResponseEntity<E>(HttpStatus.NOT_FOUND);
        }
    }
@ RequestMapping ( value = "/{id}" , method = RequestMethod . DELETE ) public ResponseEntity < E > delete ( @ PathVariable int id ) { try { E entityToDelete = this . service . findById ( id ) ; this . service . delete ( entityToDelete ) ; final String proxyClassName = entityToDelete . getClass ( ) . getSimpleName ( ) ; final String simpleClassName = StringUtils . substringBefore ( proxyClassName , "_$$_" ) ; LOG . trace ( "Deleted " + simpleClassName + " with ID " + id ) ; return new ResponseEntity < E > ( HttpStatus . NO_CONTENT ) ; } catch ( Exception e ) { LOG . error ( "Error deleting entity with ID " + id + ": " + e . getMessage ( ) ) ; return new ResponseEntity < E > ( HttpStatus . NOT_FOUND ) ; } }
Deletes an entity by id.

@param id