title: HQL get parent from child without child knowing parent
body: <p>I've the following problem: I want to retrieve the parent from a child via HQL.</p>
  
  <p><strong>Parent.hbm.xml</strong></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  &lt;class name="Parent" table="Parent"&gt;
      &lt;id name="uuid" type="java.lang.String" unsaved-value="null" access="field"&gt;
          &lt;column name="uuid" not-null="true" /&gt;
          &lt;generator class="org.hibernate.id.UUIDGenerator" /&gt;
      &lt;/id&gt;
  
      &lt;list name="events" table="ParentToChild" cascade="all-delete-orphan" lazy="false"&gt;
          &lt;key column="parentUuid" /&gt;
          &lt;index column="idx" /&gt;
          &lt;one-to-many class="Child" /&gt;
      &lt;/list&gt;
  
  &lt;/class&gt;
  
  &lt;query name="findParentByChild"&gt;
      &lt;![CDATA[
           select p from Parent as p, Child as c where c.uuid = :uuid and p.uuid = c.parentUuid 
           ]]&gt;
  &lt;/query&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p><strong>Child.hbm.xml</strong></p>
  
  <pre><code>&lt;hibernate-mapping&gt;
  &lt;class name="Child" table="Child"&gt;
  
      &lt;id name="uuid" type="java.lang.String" access="field"&gt;
          &lt;column name="uuid" not-null="true" /&gt;
          &lt;generator class="org.hibernate.id.UUIDGenerator" /&gt;
      &lt;/id&gt;
  
      &lt;other properties..&gt;
      &lt;/class&gt;
   &lt;/hibernate-mapping
  </code></pre>
  
  <p>I can see the table generated for the child contains the parentUuid column, so my question is how do I do this in HQL? Can I use the foreign key in the HQL?</p>