title: HIbernate - @Where equivalent in XML configuration for Restricting Collections
body: <p>I would like to use the functionality that is provided by @Where to restrict collections only to the items that have status ACTIVE.
  However, I cannot use annotations only xml. Therefore I look for @Where equivalent in xml but I cannot found anything.</p>
  
  <p>Example ( I need something like  element "where")</p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  &lt;class name="Teacher" table="teacher" &gt;
      ...
  
      &lt;bag name="subjects" inverse="true" cascade="save-update"&gt;
          &lt;key&gt;
              &lt;column name="id_policy" /&gt;
          &lt;/key&gt;
          &lt;one-to-many class="Subject" /&gt;
          &lt;where&gt;status = 'a'&lt;/where&gt;
      &lt;/bag&gt;
  
      ....
  &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>Of course, I can use the custom collection loader, but this is quite ugly for such simple task.
  The filter is a more suitable option but it must be enabled explicitly for Hibernate session and I simply need this "where" clause to be applied always.</p>
  
  <p>Any ideas?</p>