title: Use @XmlTransient only in some cases
body: <p>I have two classes:</p>
  
  <pre><code>public class A implements Serializable {
      ...
      @OneToMany(cascade = CascadeType.ALL, mappedBy = "fieldID")
      private Collection&lt;B&gt; bCollection;
      ...
      public Collection&lt;B&gt; getBCollection()
      {
         return bCollection;
      }
      public void setBCollection(Collection&lt;B&gt; bCollection)
      {
         this.bCollection = bCollection;
      }
  }
  
  public class B implements Serializable {
      ...
      @JoinColumn(name = "aID", referencedColumnName = "id")
      @ManyToOne(optional = false)
      private A aID;
      ...
      @XmlTransient
      public A getAID() {
         return aID;
      }
      public void setAID(A aID) {
         this.aID= aID;
      }
  }
  </code></pre>
  
  <p>I was always using <code>A</code> class - it is working as inteded, but now, I want to use <code>B</code> class in RESTful <code>GET</code> method. However, when I try to do that, <code>@XmlTransient</code> prevents showing <code>A</code> field. Is it possible to use <code>@XmlTransient</code> on <code>A</code> class, when I am using <code>B</code> class and to use it on <code>B</code> class, when I am using <code>A</code> class?</p>