Hibernate version: 3.2 cr1
I have 3 tables COUNTRY, REGION and CITY. The structure like this:
Code:
COUNTRY
ID, NAME, {Other Data}
REGION
ID, CID, NAME, {Other Data}
CITY
ID, RID, NAME, {Other Data}
COUNTRY <-----> REGION <------> CITY
1 n 1 n
There is no problem with the orm for the above in Hibernate. Now, I want to have a property "cities" under class "Country" which is a collection of the cities in a country, however, I have no idea to do mapping using HQL like this:
Code:
from City c where c.rid in (select r.id from Region r where r.cid = {country id}
Can anyone help with this? Thanks in advance.
Eric