title: JPA OneToMany insert not setting the id's correctly
body: <p>I have two entities, let's say</p>
  
  <p>Person.java:</p>
  
  <pre><code>@Entity
  public class Person implements Serializable {
  
      @Id
      @GeneratedValue(strategy = AUTO)
      private long id;
  
      @OneToMany(mappedBy = "personData", cascade = CascadeType.PERSIST)
      private List&lt;SkillsData&gt; skillsData;
          // ...
      }
  </code></pre>
  
  <p>SkillsData.java</p>
  
  <pre><code>@Entity
  @Table(name = "SkillsData")
  public class SkillsData implements Serializable {
      @Id
      @GeneratedValue(strategy = AUTO)
      private long id;
  
      @JoinColumn(name = "PERSONID")
      @ManyToOne(cascade = REMOVE)
      private Person personData;
      // ...
  }
  </code></pre>
  
  <p>When I create a person, add a list of type SkillsData to it's skillsData field and persist it everything works with no exceptions thrown, but when I browse the database directly in the SkillsData table the field PERSONID is not populated and because of that the skills added can't be referenced to the right person.
  I'm trying to fix this problem for quite some time and I'll be thankful for any help.</p>