If you are doing a query on bank accounts and how they relate to a bank, then you will want to have a many-to-one association in your mapping file.
As an example, here is a snippet for one that I have done, where many reservations are associated with one guest:
Code:
<hibernate-mapping>
<class name="domain.Reservation" table="reservations">
<id
name="key"
column="id"
type="integer">
<generator class="native"/>
</id>
<property
name="date"
column="resDate"
type="date"/>
<property
name="time"
column="resTime"
type="time"/>
<!-- guest corresponds to the attribute 'guest' in my reservation class,
while guestId is the reference made to the Guest, from this entry.
-->
<many-to-one
name="guest"
column="guestId"
class="domain.Guest"
fetch="join"
lazy="false"/>
</class>
</hibernate-mapping>
Hope this helps.