title: Cyclic references in a bidirectional many to many relationship
body: <p>I'm having a bidirectional many to many relationship in my entities. See the example below:</p>
  
  <pre><code>public class Collaboration {
  
      @JsonManagedReference("COLLABORATION_TAG")
      private Set&lt;Tag&gt; tags;
  
  }
  
  public class Tag {
  
      @JsonBackReference("COLLABORATION_TAG")
      private Set&lt;Collaboration&gt; collaborations;
  
  }
  </code></pre>
  
  <p>When I try to serialize this to JSON, I'm getting the following exception: `</p>
  
  <blockquote>
    <p>"java.lang.IllegalArgumentException: Can not handle managed/back
    reference 'COLLABORATION_TAG': back reference type (java.util.Set) not
    compatible with managed type (foo.Collaboration).</p>
  </blockquote>
  
  <p>Actually, I know this makes sense because the javadoc explicitly states that you can't use @JsonBackReference on Collections. My question is, how should I address this problem? What I've done for now is remove the @JsonManagedReference annotation on the parent side, and added the @JsonIgnore on the child side. Could someone tell me what the side effects are of this approach? Are there any other suggestions?</p>