title: How to convert nested SQL to HQL
body: <p>I am new to the Hibernate and HQL. I want to write an update query in HQL, whose SQL equivalent is as follows:</p>
  
  <pre><code>update patient set 
        `last_name` = "new_last", 
        `first_name` = "new_first" 
  where id = (select doctor_id from doctor 
              where clinic_id = 22 and city = 'abc_city');
  </code></pre>
  
  <p><code>doctor_id</code> is PK for  <code>doctor</code> and is FK and PK in <code>patient</code>. There is one-to-one mapping.</p>
  
  <p>The corresponding Java classes are Patient (with fields lastName, firstName, doctorId) and Doctor (with fields doctorId). </p>
  
  <p>Can anyone please tell what will be the HQL equivalent of the above SQL query? </p>
  
  <p>Thanks a lot.</p>