-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Many To Many Problem
PostPosted: Mon Oct 09, 2006 9:34 am 
Newbie

Joined: Mon Oct 09, 2006 9:27 am
Posts: 1
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.