title: Spring Boot @OneToMany mapping
body: <p>I'm learning Spring Boot, and I'm a bit confused. </p>
  
  <p>I created post and comment model, and I want post to have many comments.</p>
  
  <pre><code>@OneToMany(cascade = CascadeType.ALL)
  @JoinColumn(name ="post_id")
  private List&lt;Comment&gt; comments = new ArrayList&lt;&gt;();
  </code></pre>
  
  <p>And here is the comment: </p>
  
  <pre><code>@ManyToOne(fetch = FetchType.LAZY)
  @JoinColumn(name = "post_id")
  private Post post;
  </code></pre>
  
  <p>So, I would like to have comments array when I return single post but due the error: <code>java.lang.IllegalStateException Cannot call sendError()</code>
  ,I had to set <code>@JsonIgnore</code> on comments getter.</p>
  
  <p>What is the best practice for the mapping, how would I get the post comments, I guess, new http request is not recommended ?</p>