title: failed to lazily initialize a collection of role in ManyToMany relationship despite using JsonIgnore
body: <p>I have two business objects having many too many relationships. I am using a REST service to call the DAO method given below and get a list of political indicators for a political event. However though the piList in DAO successfully gives me the list of Political Indicators but it still gives me an exception </p>
  
  <p><code>Failed to lazily intialize a collection of role...</code> </p>
  
  <p>through reference chain: </p>
  
  <pre><code>org.hibernate.collection.internal.PersistentBag[0]-----&gt;PolIndicator.piList.role
  org.jboss.resteasy.spi.writerException
  org.codehaus.jackson.map.JsonmappingException"
  </code></pre>
  
  <p>I have used <code>@JsonIgnore</code> in the Political Indicator class against the political event property but still the lazy exception happens.</p>
  
  <p>Where am I going wrong?</p>
  
  <pre><code>PolEvent {
  
      @Id
      @Column(name="SEQ_EVENT_ID")
      private BigDecimal id;
  
      @Column(name="EVENT_NAME")
      private String eventName;
  
      @ManyToMany
      @JoinTable(
          name="POL_LINK_INDCTR"
          joinColumns={@JoinColumn(name="SEQ_EVENT_ID")},
          inverseJoinColumns=@JoinColumn(name="SEQ_PI_ID")
      )
      private List &lt;PolIndicator&gt; piList;
  }
  
  
  PolIndicator {
  
      @Id
      @Column(name="SEQ_PI_ID")
      private BigDecimal id;
  
      @Column(name="POL_IND_NAME")
      private String piName;
  
      @ManyToMany(mappedBy="piList")
      @JsonIgnore
      private List &lt;PolEvent&gt; eventList; 
  }
  </code></pre>
  
  <p>DAO Layer Code</p>
  
  <pre><code>public List &lt;PolIndicator&gt; getPiList (String eventId) {
  
      Criteria criteria = session.createCriteria(PolEvent.class);
      criteria.add(Restrictions.eq("id",id);
      PolEvent polEvent = new PolEvent();
      polEvent=criteria.uniqueResult();
      piList = polEvent.getPiList();
      return piList();
  }
  </code></pre>