title: JsonIgnore property if called from entity relation
body: <p>I'm trying to conditionally <code>@JsonIgnore</code> some fields from an entity if they're serialized from an other entity's collection (many to one).</p>
  
  <p>I've tried to add <code>@JsonIgnoreProperties</code> to the collection but as I understand that annotation is not for this purpose.</p>
  
  <pre><code>class A {
      //some fields
  
      @ManyToOne private B b; //if only A is requested, this should NOT be ignored    
  }
  
  class B {
      //some fields
  
      @OneToMany
      @IgnorePrivateBInAToAvoidStackOverflow
      private Set&lt;A&gt; collectionOfAs;
  }
  </code></pre>
  
  <p>Is there any way to achieve this behavior?</p>