title: Can't save entity with composite key
body: <p>I get an exception when I try to save entities when composite key is used. Here is the exception, models and repository I try to save to. Can anyone help?</p>
  
  <blockquote>
    <p>org.springframework.beans.TypeMismatchException: Failed to convert
    property value of type 'org.CheckType_$$_jvst96c_4' to required type
    'int' for property 'checkType'; nested exception is
    java.lang.IllegalArgumentException: Cannot convert value of type
    'org.CheckType_$$_jvst96c_4' to required type 'int' for property
    'checkType': PropertyEditor
    [org.springframework.beans.propertyeditors.CustomNumberEditor]
    returned inappropriate value of type 'org.CheckType_$$_jvst96c_4'</p>
  </blockquote>
  
  <pre><code>@Entity
  public class CheckType {
      @Id
      private int id;
  
      @NotNull
      private String name;
  
      @OneToMany(mappedBy = "checkType")
      private List&lt;ClientCheck&gt; checks;
      //getters and setters
  }
  
  @Entity
  public class Offer {
      @Id
      @Column(name = "offerid")
      private Integer offerId;
      //...
      @OneToMany(mappedBy = "offer")
      private List&lt;ClientCheck&gt; clientCheckList;
  
      //getters and setters
  }
  
  @Entity
  @IdClass(ClientCheckId.class)
  public class ClientCheck {
      @Id
      @ManyToOne
      @JoinColumn(name = "offer_id", referencedColumnName = "offerid")
      private Offer offer;
  
      @Id
      @ManyToOne
      @JoinColumn(name = "check_type_id", referencedColumnName = "id")
      private CheckType checkType;
  
      @Id
      private Date timestamp;
  
      private String result;
      //getters and setters
  }
  
  public class ClientCheckId implements Serializable {
      private int offer;
      private int checkType;
      private Date timestamp;
  
      //getters and setters
      //equals and hashCode
  }
  
  public interface ClientCheckRepo extends JpaRepository&lt;ClientCheck, ClientCheckId&gt; {
  }
  </code></pre>