-->
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.  [ 3 posts ] 
Author Message
 Post subject: Hibernate Designers?? Saving a many-to-many relationship
PostPosted: Wed Jul 28, 2004 2:45 pm 
Regular
Regular

Joined: Thu Jul 01, 2004 12:13 am
Posts: 68
Location: San Diego, CA
I have a "many-to-many" relationship in my DBMS with an intermediary table that has the normal PK/FKs *and* additionally columns in it describing the relationship between the tables. What I did in Hibernate is map this as a one-to-many on each side of this intermediary table. An example would be something like Employee-Projects-Project.

Now say I want to save at the Employee level. On my Set in Employee I have cascade="save-update" as well as in project, but it also seems that I need to have cascade="save-update" on each <many-to-one...> in the Projects object to accommodate saving through the whole object graph from either direction, which sees to be a bit against the Hibernate convention (ie. it defaults to none).

I guess I am wondering what the best practice would be in this circumstance. It's nice to do just one save from either direction and have everything propagate, but I don't want to do that if I take a big performance hit or something worse.

Thanks,
Lou


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 29, 2004 1:41 am 
Regular
Regular

Joined: Thu Jul 01, 2004 12:13 am
Posts: 68
Location: San Diego, CA
Some help pretty please... ;o)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 11, 2004 6:01 pm 
Beginner
Beginner

Joined: Wed Jul 21, 2004 6:50 pm
Posts: 27
I've got the same question, if anyone could point us in the right direction?

Cheers,

David


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