title: HQL query join tables
body: <p>I am using hibernate to connect to my database for a project.</p>
  
  <p>I would like to have a query that gets the products out of my database with the discription and name in a certain language. The parameter I have is the short name for the language, so first I would have to get the id of the language and then get the text in the required languages.</p>
  
  <p>I have tried the following hql query, without success.</p>
  
  <pre><code>from Products as p
  where p.productlanguages.languages.shortname like 'eng'
  </code></pre>
  
  <p>This is an image of the part of the database where the data should come from:
  <img src="https://i.stack.imgur.com/eFR2N.png" alt="database"></p>
  
  <p>I have got the desired result with an sql query, but I can't seem to get it to work in hibernate. But I would prefer to do this in hql.</p>
  
  <pre><code>SELECT * FROM products p 
  INNER JOIN productlanguage pl ON pl.Products_id = p.id 
  WHERE pl.Languages_id = 
  (
  SELECT id FROM languages 
  WHERE Shortname = 'eng'
  );
  </code></pre>
  
  <p>Could anyone tell me how to build this hql query?
  Thank you.</p>