title: Hibernate NamedQuery with a condition on inner List
body: <pre><code>    class A{
  // one to many mapping
      List&lt;B&gt; listOfB;
      //getter and setter;
      class B {
      String s;
      //getter and setter
      }
  </code></pre>
  
  <p>Now, when I get class A , it will return all the associated class Bs in listOfB. But I need certain condition on which of B should be in response. Like Get A such that listOfB contains all such B for which s = 'something'.</p>
  
  <p>EDIT : currently this is not working:</p>
  
  <pre><code>select a from A a where a.listOfB IN (select b from a.listOfB b where b.s='something');
  </code></pre>