title: object references an unsaved transient instance when mapping is @ManyToOne
body: <p>I have two tables and objects : StudentsInGroup and GroupRegistration.</p>
  
  <pre><code>class StudentInGroup {
  @Id
  @Column (name = "ID")
  private Integer id;
  
  // other fields
  
  @ManyToOne(fetch = FetchType.EAGER, targetEntity = GroupRegistration.class)
  @JoinColumn(name = "GROUP_CODE")
  private GroupRegistration groups;
  
  // other methods
  }
  
  
  class GroupRegistration {
  @Id
  @Column (name = "ID")
  private Integer Id;
  
  // other fields
  
  @Column(name = "GROUP_CODE")
  private Integer groupCode;  // this is not primary key
  
  // other methods
  }
  </code></pre>
  
  <p>I have form and method insertStudentInGroup(StudentInGroup student); but when I invoke this method I got exception  : object references an unsaved transient instance - save the transient instance before flushing: StudentInGroup.groups -> GroupRegistration </p>
  
  <p>I saw that people had this kind of problem but they used cascades , I don't need cascades. Can anybody help me.</p>