title: Hibernate insert cascade not inserting foreign key
body: <p>I have two entities:</p>
  
  <pre><code>@Entity
  public class File
  .......
  @Id @GeneratedValue(strategy=GenerationType.AUTO)
  private int id;
  @OneToMany(fetch=FetchType.LAZY, mappedBy="file", cascade=CascadeType.ALL)
  private List&lt;Tag&gt; tags;
  .......
  OTHER PROPERTIES
  .......
  
  @Entity
  public class Tag
  .......
  @Id @GeneratedValue(strategy=GenerationType.AUTO)
  private int id;
  @ManyToOne
  @JoinColumn(name="file_id")
  private File file;
  @Column
  private String tag;
  .......
  OTHER PROPERTIES
  .......
  </code></pre>
  
  <p>I am trying to insert into File (and subsequently Tag) by doing the following:</p>
  
  <pre><code>File file = new File();
  Tag tag = new Tag();
  tag.setTag("tag1");
  Tag2 tag2 = new Tag();
  tag2.setTag("tag2");
  List&lt;Tag&gt; tags = new ArrayList&lt;Tag&gt;();
  tags.add(tag);
  tags.add(tag2);
  file.setTags(tags);
  ---Add other file attributes here---
  </code></pre>
  
  <p>I am then inserting the file in my DAO using:</p>
  
  <pre><code>sessionFactory.getCurrentSession().saveOrUpdate(file); 
  </code></pre>
  
  <p>In my logs I see an insert into my "file" table and 2 inserts into my tag table, however, the foreign key in my tag table that points to my file table (file_id) is NULL. </p>
  
  <p>What could I possibly be doing wrong?</p>