title: Hibernate many-to-many: Criteria for looking up all class A which contains class B
body: <p>I have 2 classes which have many to many relationship.  I take the 'Question' and 'Tag' as an example to make the case more understandable.  </p>
  
  <p>For each question, you have several tags.  The same as for tag.</p>
  
  <p>What I would like to do is to get all questions (and their corresponding tags) if the question contain a tag says "hibernate".</p>
  
  <p>I can at most do it with a SQLQuery in the many-to-many table and return a list of the question ID.  Then use a criteria with a restrictions.in and grab all questions.  But it's too clumsy and I bet there is a better way of doing it, is there?</p>