title: JPA Replace in database Annotation
body: <p>I have this class:</p>
  
  <pre><code>@Entity
  @Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "date", 
      "meterTime" }) })
  public class Meter {
  
      public enum MeterTime {
          AFTER_FAST, AFTER_MEAL
      }
  
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      private long id;
  
      @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
      private Date date;
  
      @Enumerated(EnumType.STRING)
      private MeterTime meterTime;
  
      private Float meter;
  
      // constructor, getters and setters
  
  }
  </code></pre>
  
  <p>now, when I try to insert a row with date and meterTime already existents, the row is not inserted..</p>
  
  <p>but! I want to be inserted (and replace the existent row)</p>
  
  <p>how can I do this?</p>
  
  <p>Thanks!</p>