title: Java spring JPA Repository Entity is not deleted
body: <p>In my code, I fetch an entity and try to delete it, using the interface <code>ProductRepository</code> which extends <code>JpaRepository</code>:</p>
  
  <pre><code>@Repository
  public interface ProductRepository extends JpaRepository&lt;Product, Long&gt; {}
  </code></pre>
  
  <p>Code, and <code>System.out.println()</code> output from code:</p>
  
  <pre><code>@PostMapping("/admin/product/delete")
  public String deleteProduct(
          @RequestParam String productId
  ){
      Long id = Long.parseLong(productId);
      System.out.println("long id from deleteProduct: " + id);
  
      productService.deleteProductById(id);
      return "redirect:/product";
  }
  </code></pre>
  
  <p>sysout:</p>
  
  <pre><code> long id from deleteProduct: 38
  </code></pre>
  
  <p>Service method <code>deleteProductById()</code>:</p>
  
  <pre><code>public void deleteProductById(long productId){
      Product product = productRepository.getOne(productId);
      System.out.println("Product:\n" + product);
      productRepository.delete(product);}
  </code></pre>
  
  <p>sysout from <code>deleteProductById</code>:</p>
  
  <pre><code>Product:  Product{id=38, productName='zip',
  producer=lightmarket.mvc.model.domain.Producer@182a383}
  </code></pre>
  
  <p>But the entity is not deleted... 
  I must point out that all other CRUD operations work. Create, Update, Read - all are alright! Only 'delete' is not working.</p>