-->
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.  [ 2 posts ] 
Author Message
 Post subject: Search conditions and bags
PostPosted: Wed Aug 25, 2010 9:21 am 
Beginner
Beginner

Joined: Thu Sep 17, 2009 8:53 am
Posts: 20
Hey guys!

Following problem is giving me a hard time and I seem to be unable to find anything helpful on the web.

Example:
I've got a table COMPANY and a table ROLE.
Companies shall have roles assigned to them (n:m), so that company 'Hew Pack' might be 'Printer Manufacturer' and 'Software Manufacturer'. So I've got a table LINK_COMPANY_ROLE as well, which does just that. Furthermore my .hbm.xml file for COMPANY contains a bag 'roles'.

I now want to be able to do a query, which returns all those companies, who are assigned the 'Software Manufacturer' role (so who's bag contains that role).
Yet I'm absolutely clueless how to do that.

I'd be very grateful, if you could point me into the right direction and/or provide me with a sample which does something similar.

Have a nice day
Benjamin


Top
 Profile  
 
 Post subject: Re: Search conditions and bags
PostPosted: Thu Aug 26, 2010 3:47 am 
Beginner
Beginner

Joined: Thu Sep 17, 2009 8:53 am
Posts: 20
Morning!

I've just solved my above problem, which was pretty easy, as already expected.
Just needed to find how to do it :)

For all those interested, I recommend reading following blog by Ayende:
http://ayende.com/Blog/archive/2006/10/ ... rnate.aspx

Have a nice day


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

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.