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: Cacading delete
PostPosted: Tue Sep 05, 2006 7:55 am 
Newbie

Joined: Tue Sep 05, 2006 7:47 am
Posts: 1
I've a problem to understand a feature of Nhibernate I've read the documentation, look at a couple of sample but never find what I wanted to realize.

I have a many to many association between two tables "Order" and "Product" which is a table "OrderLine" with just the two foreign keys.

I want the following behaviour:

If I delete an object "Order", it's always succed and delete also all OrderLines item linked to this Order. But it wil never delete a Product.

If I delete an object "Product", it can fail if some orderlines use this product.

Sorry but I think I don't understand really well the "inverse" and cascade attributes in the mapping :-(

Thx for your help.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 06, 2006 4:34 am 
Senior
Senior

Joined: Wed Jun 15, 2005 4:17 am
Posts: 156
inverse and cascade serve for different purposes. what you will want is to focus on cascade. if you want more specific help, post more details (mappings, classes etc)

radu


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.