title: How can I use multiple Joins in JPA2 Criteria Query?
body: <p>It's a dum down version of a real problem</p>
  
  <p>I have Three Tables <code>STUDENT</code> <code>ADDRESS</code> <code>CLASS</code></p>
  
  <p><code>STUDENT ManyToOne ADDRESS</code>
  <code>STUDENT ManyToMany CLASS</code></p>
  
  <p>I need to bring all the students who have same address and go to same class.</p>
  
  <p>Sql would simply be (just writing this on the fly and have not tested it)</p>
  
  <p><code>Select * from STUDENT s join ADDRESS a on s.addressId = a.addressId join CLASS c on c.classId = s.classId</code></p>
  
  <p>Now I am new to Criteria and while have been able use it reasonbly so far , I am totally stuck as how should I do this join have looked every where documentation by Oracle , Jboss etc but no indication on how this should be done and all the stabs I have taken in the dark have been unsuccessful.
  Even on SO there are many questions in similar tone but when you read them it is something else thats being ask.</p>