-->
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 mapping concepts
PostPosted: Tue Aug 09, 2005 6:12 pm 
Newbie

Joined: Tue Aug 09, 2005 5:51 pm
Posts: 1
Hi all,

Im new to Hibernate- had a conceptual question about many-to-many bidirectional mappings with link tables.I have looked at documentation and also in a couple of books but have been unable to figure something out.

Please consider this situation(from the CaveatEmptor example):

Categories and Items have a many-to-many relationship which is represented in a link table.Collections of either are present in each class using the mapping files as recommended.Now if I wanted to retrieve info from a join of these(with a restriction),
eg: If the link table was not present,I'd have used the following query:

Code:
Select * from category inner join item where category="ABC"


how would I do this without having to map the link table explicitly(that is the solution Ive seen to similar questions on this forum.)Link tables are purely a normalization concept and should not have to be mapped.If all that this table contains is the linking info between these two entities, it should not be a class by itself- its just not object-oriented.

I apologize if this is a trivial issue which has been implied - I have not found an example which spells out how to do this.

Thanks

Anirudh


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.