I have the following classes:
Code:
Category
CategorizedOrganization
Organization
Address
The relationships between them are the followings:
Category & CategorizedOrganization: one-to-many
CategorizedOrganization & Organization: one-to-one (the first one contains the second one)
Organziation & address: one-to-many
I need to find out all organizations under a given category and in a given city (one attribute of the address) .
The following HQL doesn't yield a right result.
Code:
select o from Category c left join c.categorizedOrganizations co left join fetch co.organzation o left join c.addresses a where c.id = ? and a.city = ?
Can someone help me out on this HQL, please.
Hibernate version:
3.x