title: Join two tables in Hibernate with Criteria API and Annotation
body: <p>I want to join 2 tables in MySQL with Hibernate Annotations and Criteria
  Like for example:</p>
  
  <p>I have 2 tables,  candidates and jobs, having 2 columns each:</p>
  
  <ul>
  <li>candidates: candID &amp; candName </li>
  <li><p>jobs: jobID &amp; jobName</p>
  
  <pre><code>                        candidates                     jobs       
                candID    candName          jobID          jobName
                    1          abc                       1               job1
                    2          xyz                       2               job2
  </code></pre></li>
  </ul>
  
  <p>i need to create a query in Criteria in hibernate     as:</p>
  
  <pre><code> select candName  ,jobName    from candidates as c ,jobs as j  
   where c.candID = j.jobID where candName = abc and jobName=job1
  </code></pre>
  
  <p>what will be the criteria query for that and most importantly what will i write in my annotation class ( as i am using spring annotations) and do i need to write anything in my applicantioncontext.xml...</p>
  
  <p>Thanks</p>
  
  <p>I will be really greatful if you can help me with that as i am struggling for last  3 days for it with no success</p>
  
  <p>thanks</p>