Skip to content

Instantly share code, notes, and snippets.

@Senhordim
Created October 6, 2017 20:50
Show Gist options
  • Save Senhordim/3932b98a7516c9c7f11387dd78d45edf to your computer and use it in GitHub Desktop.
Save Senhordim/3932b98a7516c9c7f11387dd78d45edf to your computer and use it in GitHub Desktop.
@PutMapping(value="/{id}")
public Product updateProductWithId(@PathVariable Long id, Product product) {
Product currentProduct = productDAO.findOne(id);
currentProduct.setCode(product.getCode());
currentProduct.setDescription(product.getDescription());
currentProduct.setUnitPrice(product.getUnitPrice());
return productDAO.save(product);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment