title: whenever I am going to update a record each time it will create a new entry ( not able to update a record in database)
body: <p>I am developing an API, whenever I am going to update a record by using JpaRepository  method, each time it will create a new entry.
  Below are my Entity class,Repository,Service &amp; Controller.</p>
  
  <p>Da_Alert(Entity):</p>
  
  <pre><code>public class Da_Alert implements Serializable {
  private static final long serialVersionUID = 1527460893291554177L;
  
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  @Column(name="id")
  int alertId;
  
  @Column(name="alertName")
  String alertName;
  
  @Column(name="alertDescription")
  String alertDescription;
      .
      .//getter/Setter
   }
  </code></pre>
  
  <p>Da_Alert_Repository (Repository):</p>
  
  <pre><code>     @Repository
       public interface Da_Alert_Repository extends JpaRepository&lt;Da_Alert, 
         Integer&gt; {
  
       }
  </code></pre>
  
  <p>Da_Alert_Service (Service):</p>
  
  <pre><code> @Service
  
   public class Da_Alert_Service  {
  
  @Autowired
  Da_Alert_Repository DaAlertRepository;
  
  
  public List&lt;Da_Alert&gt; findAll() {
      return DaAlertRepository.findAll();
  }
  
  public Optional&lt;Da_Alert&gt; findById(Integer id) {
      return DaAlertRepository.findById(id);
  }
  
  public Da_Alert save(Da_Alert Da_Alert) {
      return DaAlertRepository.save(Da_Alert);
  }
  
  public void deleteById(Integer id) {
      DaAlertRepository.deleteById(id);
  }
  
  }
  </code></pre>
  
  <p>Da_Alert_APIController (API):</p>
  
  <pre><code> @RestController
   @RequestMapping("/api/v1/alert")
   @Slf4j
   public class Da_Alert_APIController {
  
  @Autowired
  Da_Alert_Service DaAlert_Service;
  
      @PutMapping("/updateAlert/{id}")
      public ResponseEntity&lt;Da_Alert&gt; update(@PathVariable Integer id, 
      @Valid @RequestBody Da_Alert Da_Alert) {
      if (!DaAlert_Service.findById(id).isPresent()) {
         // log.error("Id " + id + " is not existed");
          ResponseEntity.badRequest().build();
      }
  
      return ResponseEntity.ok(DaAlert_Service.save(Da_Alert));
      }
  }
  </code></pre>
  
  <p>URL:</p>
  
  <pre><code> localhost:****/api/v1/alert/updateAlert/1    (PUT)
  </code></pre>
  
  <p>body:</p>
  
  <pre><code>  {
       "alertName":"update Test allert",
       "alertDescription":"Test"
       }
  </code></pre>