title: Save entity object with foreign key using CrudRepository
body: <p>I have two entity classes with @ManyToOne relationship as below.</p>
  
  <pre><code>@Entity
  public class Student {
  
    @Id
    private Integer studentId;
  
    @Column(nullable = false)
    private String studentName;
  
    @ManyToOne(targetEntity = School.class, fetch = FetchType.LAZY, optional = false)
    @JoinColumn(referencedColumnName = "schoolId", insertable = false, updatable = false)
    private School school;
  
    //Getters and Setters methods
  </code></pre>
  
  <p>.</p>
  
  <pre><code>@Entity
  public class School {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer schoolId;
  
    @Column(nullable = false)
    private String schoolName;
  
    //Getters and Setters methods
  </code></pre>
  
  <p>When I try to save the student object using CrudRepository default method <code>studentRepository.save(student)</code> with JSON payload, it gives me an error <code>java.sql.SQLException: Field 'school_id' doesn't have a default value</code>.  When I run in the debug mode I can see that the School object is being set correctly.</p>
  
  <p>My JSON payload is as follows:</p>
  
  <pre><code>[
      {
        "studentId": "2015020",
        "studentName": "ABC",
        "school": {
          "schoolId": 1
        }
      }
  ]
  </code></pre>
  
  <p>I am new to Spring Data JPA, so this might be a very basic mistake.</p>