title: Hibernate collections are NULL after persist
body: <p>JPA entity <code>Batch</code> has <code>OneToMany</code> relation to <code>Event</code>:</p>
  
  <pre><code>@OneToMany(mappedBy = "owningBatch")
  private Set&lt;Event&gt; containingEvents;
  </code></pre>
  
  <p>and <code>Event</code> has ManyToOne relation to <code>Batch</code>:</p>
  
  <pre><code>@ManyToOne
  @JoinColumn(name = "BATCH_ID")
  private Batch owningBatch;
  </code></pre>
  
  <p>after creating new instance and persisting it the <code>containingEvents</code> are still <code>NULL</code>.
  But when I use empty <code>Set</code>:</p>
  
  <pre><code>@OneToMany(mappedBy = "owningBatch")
  private Set&lt;Event&gt; containingEvents = Sets.newHashSet();
  </code></pre>
  
  <p>then after persisting the <code>containingEvents</code> are replaced with Hibernate's <code>PersistentSet</code>.
  I would expect this replacement to happen even in first case. Why is it not happening?</p>
  
  <p>DAOs are implemented by Spring Data JPA.</p>
  
  <p>Spring Boot 2.0.4.RELEASE<br/>
  Spring Data JPA 2.0.4.RELEASE<br/>
  Hibernate 5.2.17.Final<br/>
  Hibernate JPA 2.1 1.0.2.Final</p>