Hibernate version: 1.2.0 Beta 1
Database version: SQL Server 2000
Hi, I have a many to many relation like this
User ---------> UsersXShops <------------- Shop
the Mapping it's ok, but i have question about HQL.
SELECT elements(u.Shops)
FROM Users u
WHERE u.UserId = :userId
This HQL is ok, and return me a Shop's Collection.
Shops, have a property Company
so, I Want to filter this collections with a companyId
like shop.Company.CompanyId = :companyId.
It's that posible? Can I filter that in only one query, and mantaining the many to many relation?
Thanks, Sorry about my english.
|