-->
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: getting multiple inserts..
PostPosted: Tue Jun 20, 2006 8:16 am 
Newbie

Joined: Tue Jun 20, 2006 8:11 am
Posts: 7
Hi All,

I have a typical scenario. With Orders & Order items which links to a products table..

Whenever I create a new Order, I always end up with twice as many inserts in both the Orders and Order Items table.. Hoping someone might see an obvious error in my mapping..

I have the main Order mapping which has a many to many link with products forming the order_items.. which is defined as;

<set lazy="false" name="products" table="order_products">
<key column="orderSerial" />
<many-to-many column="productSerial" class="net.dbws.sandz.beans.Product"/>
</set>

and the product mapping is just a very straight forward mapping file with NO sets/or linkage references..

I have a DAO for the order and save the order using that.. I save using
session = factory.openSession();
session.saveOrUpdate(charge);
session.flush();

Can anyone see a problem with the mapping ? Any thoughts really appreciated. Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 9:28 am 
Senior
Senior

Joined: Sun Jun 04, 2006 1:58 am
Posts: 136
set inverse=true

_________________
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 20, 2006 10:51 am 
Newbie

Joined: Tue Jun 20, 2006 8:11 am
Posts: 7
Thanks for the reply..

After 2 days of trying to discover a technical issue reagrding hibernate, 'quite embarassingly' the problem lied within html source... not the db code.. :|

Thanks again anyway...


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.