title: Query conversion - Sql to Hql
body: <p>I have this query and I need to convert it in hql but I am little confused, don't know how to write condition presented in 'where' clause in hql.</p>
  
  <pre><code>SELECT
      message 
  FROM
      p_message 
  WHERE
      message_id=(
          SELECT
              a.scene 
          FROM
              p_config a 
          INNER JOIN
              p_rec_type b 
                  ON a.email_id=b.email_id 
                  AND rec_type=2 
          WHERE
              a.email_type=1
      )
  </code></pre>
  
  <p>what is hql equivalent of this sql query?</p>