-->
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: WHo can explain Inverse="true" in detail?
PostPosted: Mon Jun 04, 2007 2:26 am 
Newbie

Joined: Thu Apr 21, 2005 6:04 am
Posts: 8
Can you explain Inverse="true" ?.

http://simoes.org/docs/hibernate-2.1/155.html

I just want to know at what situation inverse="true" should be used and what is the difference between cascade and inverse?.

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 07, 2007 2:00 am 
Newbie

Joined: Fri May 25, 2007 3:43 am
Posts: 4
Hi,

The both attributes may use in <set> element.

Cascade attribute is used to cascade the child entity, while saving/updating/deleting the parent entity.

Inverse attribute is used to mention either parent or child entity can take care of the relationship for these entities.

for example,

<set inverse="true"
name="par"> - parent entity will take care of relationship handling for child.

<set inverse="false"
name="par"> - child entity will take care of relationship handling for child.

i.e

insert into parent(id,name) values(?,?)
insert into child(id,name,parent_id) values(?,?,null)
update child set parent_id=? where id=?

Thanks.


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.