title: JpaRepository delete child elements
body: <p>I'm trying to do a very simple delete operation, but somehow it doesn't work since I updated the DAOs to JpaRepository. Basically it's this:</p>
  
  <pre><code>A a = aRepository.findOne(id);
  a.setSomeField("someNewString");
  
  List&lt;B&gt; bList = a.getBs();
  bList.clear();
  aRepository.saveAndFlush(a);
  </code></pre>
  
  <p>The field get's updated as expected, but the <code>bList</code> stays unchanged. I've even tried:</p>
  
  <pre><code>A a = aRepository.findOne(id);
  a.setSomeField("someNewString");
  
  List&lt;B&gt; bList = a.getBs();
  for(B b : bList) {
     bRepository.delete(b);
  }
  bRepository.flush();
  bList.clear();
  aRepository.saveAndFlush(a);
  </code></pre>
  
  <p>Still the same...</p>
  
  <p>Class A looks like this:</p>
  
  <pre><code>@Entity
  @Table(name = "A")
  public class A implements Serializable {
      private static final long serialVersionUID = -1286451120913657028L;
  
      @Column(name = "id", length = 16, nullable = false, updatable = false)
      @GenericGenerator(name = "uuid", strategy = "uuid2")
      @GeneratedValue(generator = "uuid")
      @Basic(fetch = FetchType.EAGER)
      @Id
      protected UUID id;
  
      @OneToMany(mappedBy = "a", fetch = FetchType.EAGER)
      @Cascade({ CascadeType.ALL })
      List&lt;B&gt; bList;
  
      // getter + setter
  }
  </code></pre>
  
  <p>What am I doing wrong?!</p>
  
  <hr>
  
  <p>Class B:</p>
  
  <pre><code>@Entity
  @Table(name = "B")
  public class B implements Serializable {
      @Column(name = "id", length = 16, nullable = false, updatable = false)
      @GenericGenerator(name = "uuid", strategy = "uuid2")
      @GeneratedValue(generator = "uuid")
      @Basic(fetch = FetchType.EAGER)
      @Id
      protected UUID id;
  
      @ManyToOne(optional = false)
      @JoinColumns({ @JoinColumn(name = "A_id", referencedColumnName = "id", nullable = false) })
      @Valid
      A a;
  
      // setter + getter
  }
  </code></pre>
  
  <p>Setters and getters are all just as simple as possbile:</p>
  
  <pre><code>public List&lt;B&gt; getBList() {
      return bList;
  }
  
  public void setBList(List&lt;B&gt; bList) {
      this.bList = bList;
  }
  </code></pre>
  
  <hr>
  
  <p>Some more information:</p>
  
  <ul>
  <li>spring 3.2.2</li>
  <li>hibernate 4.2.2</li>
  <li>spring-data-commons 1.5.1</li>
  <li>spring-data-jpa 1.3.2</li>
  </ul>