-->
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: Many to Many relationship update getting fired
PostPosted: Mon Nov 03, 2003 8:37 am 
Beginner
Beginner

Joined: Thu Sep 25, 2003 10:30 am
Posts: 23
Location: india
Hi,
I got this problem I got this many-to-many relation between two beans. Agent and Location with the third table being created "agent_link". The problem is there are already location defined in Location table.

Whenever I create a new agent an update statement is fired on the Location table which I don't want. How can I solve this problem. My mapping file is pretty simple as per the specification.
One more thing i would like to add is that the Agent contains list of Location but the Location bean doesn't have the collection for Agent.
I didn't wanted to keep the relationship 2 ways.
Am I doing anything wrong over here.
regards
prasad


Top
 Profile  
 
 Post subject: Re: Many to Many relationship update getting fired
PostPosted: Mon Nov 03, 2003 11:40 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
prasad wrote:
Whenever I create a new agent an update statement is fired on the Location table which I don't want.

Don't update the location object.
And don't use cascade="save-update"

_________________
Emmanuel


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.