title: Applying the Hibernate filter attribute to a Bag with a many-to-many relationship
body: <p>Consider the following Hibernate mapping file:</p>
  
  <pre><code>&lt;hibernate-mapping ...&gt;
  &lt;class name="ContentPackage" table="contentPackages"&gt;
      &lt;id name="Id" column="id" type="int"&gt;&lt;generator class="native" /&gt;&lt;/id&gt;
      ...
      &lt;bag name="Clips" table="contentAudVidLinks"&gt;
        &lt;key column="fk_contentPackageId"&gt;&lt;/key&gt;
        &lt;many-to-many class="Clip" column="fk_AudVidId"&gt;&lt;/many-to-many&gt;
        &lt;filter name="effectiveDate" condition=":asOfDate BETWEEN startDate and endDate"  /&gt;
      &lt;/bag&gt;
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>When I run the following command:</p>
  
  <pre><code>  _session.EnableFilter("effectiveDate").SetParameter("asOfDate", DateTime.Today);
  
    IList&lt;ContentPackage&gt; items = _session.CreateCriteria(typeof(ContentPackage))
                                       .Add(Restrictions.Eq("Id", id))
                                       .List&lt;ContentPackage&gt;();
  </code></pre>
  
  <p>The resulting SQL has the WHERE clause on the intermediate mapping table (contentAudVidLinks), rather than the "Clips" table even though I have added the filter attribute to the Bag of Clips.</p>
  
  <p>What am I doing wrong?</p>