title: Hibernate filter Entity where oneToMany relation contains an object
body: <p>I want to use the hibernate filter but I don't know if what I want to do is possible</p>
  
  <p>I have 2 entities :</p>
  
  <p>Message and MessageUser.</p>
  
  <p>A Message has a list of MessageUser.</p>
  
  <p>I want to create a filter so I can do something like :</p>
  
  <pre><code>final Session filteredSession = sessionFactory.openSession();
  final Filter filter = filteredSession.enableFilter("userRecipient");
  filter.setParameter("userRecipient", myUser);
  filter.validate();
  
  final List&lt;Message&gt; userMessages = filteredSession.createQuery("from Message").list();
  </code></pre>
  
  <p>it returns me only the message where myUser is the recipient ?</p>
  
  <p>is it possible to to and how?</p>
  
  <p>Thanks a lot !</p>