-->
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.  [ 5 posts ] 
Author Message
 Post subject: Maybe a silly question
PostPosted: Fri Jul 28, 2006 6:47 am 
Newbie

Joined: Fri Jul 28, 2006 6:41 am
Posts: 6
Hello ppl. I'm new to hibernate. I was reading the reference and I didn't exactly understand one thing while doing this.
http://www.hibernate.org/hib_docs/v3/re ... orial.html
At the first chapter there is a point where it says:

" Hibernate supports all kinds of collection mappings, a <set> being most common. For a many-to-many association (or n:m entity relationship), an association table is needed. Each row in this table represents a link between a person and an event. The table name is configured with the table attribute of the set element. The identifier column name in the association, for the person's side, is defined with the <key> element, the column name for the event's side with the column attribute of the <many-to-many>. You also have to tell Hibernate the class of the objects in your collection (correct: the class on the other side of the collection of references).

The database schema for this mapping is therefore:"


So the question is...
We create a database with 2 tables and map them. But... if we want to create the many-to-many mapping we have to create the third table before configuring the xml files?? So if this is true, if the DB has already many tables,would this be a cost to the DB,since we would have to create more and more tables?

Thnx in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 9:56 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
no you don't have to create a third table

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 12:57 pm 
Newbie

Joined: Fri Jul 28, 2006 6:41 am
Posts: 6
well i tried but i didn't find a positive result. i'll check it tomorrow again. too tired now. will send some feedback.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 3:12 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh ? a many-to-many does require some kind of table to be in the middle, either an existing one or a new to put the references.

in any case why are you mapping something as a many-to-many if it really isn't ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 28, 2006 4:40 pm 
Newbie

Joined: Fri Jul 28, 2006 6:41 am
Posts: 6
i was just reading the tutorial and had this question. i'll search it tomorrow and rate ;)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.