title: Hibernate do not insert child object
body: <p>I am having the following Entities</p>
  
  <pre><code>@Entity
  @Table(name = "school")
  public class School {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "sch_id", unique = true, nullable = false)
      private Integer schoolId;
  
      ... 
  }
  
  @Entity
  @Table(name = "student")
  public class Student {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      @Column(name = "stu_id", unique = true, nullable = false)
      private Integer studentId;
  
      ...
  
      @ManyToOne(fetch = FetchType.EAGER)
      @JoinColumn(name = "school_id", referencedColumnName = "sch_id", insertable = false, updatable = false, nullable = false)
      @JsonIgnore
      private School school;
  }
  </code></pre>
  
  <p>Now when I am saving a new student object, the generated insert query for the student table does not contain the field 'school_id'. </p>
  
  <pre><code>SessionFactory.getCurrentSession().saveOrUpdate(student), 
  </code></pre>
  
  <p>how can I include 'school_id' to the insert query. Please note I do not want to insert/update the school object. I just set schoolId in the school object and it is set into the students school object.</p>