code: @RequestMapping(method = RequestMethod.POST)
      public ResponseEntity<E> save(HttpServletRequest request) {
  
          final String simpleClassName = getEntityClass().getSimpleName();
          final String errorMessagePrefix = "Error when saving entity of type "
              + simpleClassName + ": ";
  
          BufferedReader reader = null;
          // read and parse the json request body
          try {
              reader = request.getReader();
  
              E entity = objectMapper.readValue(reader, getEntityClass());
  
              // ID value MUST be null to assure that
              // saveOrUpdate will save and not update
              final Integer id = entity.getId();
              if (id != null) {
                  LOG.error(errorMessagePrefix + "ID value is set to " + id
                      + ", but MUST be null");
                  return new ResponseEntity<E>(HttpStatus.BAD_REQUEST);
              }
  
              this.service.saveOrUpdate(entity);
              LOG.trace("Created " + simpleClassName + " with ID " + entity.getId());
              return new ResponseEntity<E>(entity, HttpStatus.CREATED);
          } catch (Exception e) {
              LOG.error(errorMessagePrefix + e.getMessage());
              return new ResponseEntity<E>(HttpStatus.BAD_REQUEST);
          } finally {
              IOUtils.closeQuietly(reader);
          }
      }
docs: Create/save an entity.