@RequestMapping(value = "/{id}", method = RequestMethod.GET)
  public @ResponseBody Category findCategory(@PathVariable("id") Long id) {

    return categoryService.findById(id);
  }
  @RequestMapping(method = RequestMethod.GET, headers = "Accept=application/xml")
  public @ResponseBody List<Category> find() {

    return categoryService.find();
  }
  @RequestMapping(method = RequestMethod.PUT)
  @ResponseStatus(HttpStatus.OK)
  public void update(@RequestBody Category entity) {

    categoryService.update(entity);
  }
  @RequestMapping(value = "/{id}", method = RequestMethod.DELETE)
  @ResponseStatus(HttpStatus.OK)
  public void delete(@PathVariable("id") Long id) {

    categoryService.delete(id);
  }
  @RequestMapping(method = RequestMethod.POST)
  @ResponseStatus(value = HttpStatus.CREATED)
  public void create(@RequestBody Category entity) {

    categoryService.create(entity);
  }