-->
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: Cascade-save HELP !!!!
PostPosted: Thu Aug 23, 2007 12:24 am 
Beginner
Beginner

Joined: Wed Aug 22, 2007 5:53 am
Posts: 38
I have 2 entities viz. Item and Bid. I have a bidirectional association.
i.e.
one-to-many association From Item to Bid.
many-to-one association from Bid to Item.

The following is the part of Item.hbm.xml :

<!-- Item - Bid Association - One-to-Many -->
<set name="bids" inverse="true" cascade="save-update">
<key column="ITEM_ID" ></key>
<one-to-many class="Bid"/>
</set>

Now when i say session.save(item) -> it works...
but when i add aBid to item using item.addBid(aBid); //addBid is just a
//convenient method
this is not making aBid persistent. (not inserting a row in BID table)


code:

// Convenient Method

public void addBid(Bid bid)
{
this.getBids().add(bid);
bid.setItem(this);
}


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.