title: How to use Hibernate Criteria for joining two tables with OneToMany  relation
body: <p>I have two tables for which I can't implement mapping <code>@OneToMany</code> in their entities unless I have a circle dependency. I want to create a Hibernate Criteria so that I'd be able to join this tables on ids' fields plus a restriction. However, I have a sql query which gives me a result I'm looking for, I failed to understand how to implement the criteria.</p>
  
  <p>Tables which have a <strong>shared id</strong>:</p>
  
  <pre><code>|  Table A  | Table B |
  |id         | id      |
  |languageId | code    |
  |comment    |         |
  </code></pre>
  
  <p>SQL query:</p>
  
  <blockquote>
    <p>select a.id, a.languageId, a.comment,
    b.code from TableA a join TableB b on
    a.id=b.id</p>
  </blockquote>
  
  <p>Could anybody help me to write the Hibernate Criteria?</p>
  
  <p>Thank you in advance,
  L.</p>