title: HQL query to get data from multiple tables
body: <p>I have 2 tables - A and B. And each has a corresponding hbm.xml and pojo.<br>
  <code>
  Class A{<br>
  &nbsp; String aId;<br>
  &nbsp; String col;<br>
  }<br>
  Class B{<br>
  &nbsp; String bId;<br>
  &nbsp; String aId;//as reference to class A<br>
  &nbsp; A aObj;<br>
  }<br>
  B.hbm.xml contains the following entry to map A to B:<br>
  &lt;many-to-one name="aId" column="AID" not-null="true" class="com.pojo.A" unique="true"/&gt;<br>
  </code>
  My requirement is that, whenever an object of B is created, it should push data into table A as well. Similarly when I read from B, it should give me data from A as well based on <b>aId</b> match. It is a one-one mapping. I want to pass the <b>aId</b> value as input to the query. And get the data from both the tables corresponding to that matched row.
  Can some one tell me how to use HQL queries to achieve this? And is the structure that I have now is correct for my requirement?</p>