-->
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.  [ 4 posts ] 
Author Message
 Post subject: Saving Relation for an Immutable Entity
PostPosted: Mon Nov 07, 2005 9:18 am 
Newbie

Joined: Mon Nov 07, 2005 9:04 am
Posts: 2
I have an Entity A which is Immutable, and an Entity B which is mutable. There is a many to many relationship defined between A and B. Now I have a collection of Entity B which I have to associate with Entity A.
If I write
session.update(a)
where a is an instance of Entity A
my relationship is not getting saved as it doesnt fire any insert queries for relationship. I know I can do it other way round(saving Entity B one by one). But I just wanted to know if there is any smoother way to do this.
I hope I am not missing any point here.

Thanks
Lal


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 2:59 am 
Beginner
Beginner

Joined: Tue Oct 18, 2005 3:57 pm
Posts: 48
Location: Los Angeles, CA
Mind posting your code + mapping?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 08, 2005 8:11 am 
Beginner
Beginner

Joined: Fri Oct 28, 2005 10:46 am
Posts: 37
And while you're coming up with that, I'll go ahead and direct you to some cascading documentation because it sounds like it might help. You might also read about the "inverse" attribute in Chapter 7 of the reference guide.


Top
 Profile  
 
 Post subject: Thanks
PostPosted: Tue Nov 08, 2005 8:51 am 
Newbie

Joined: Mon Nov 07, 2005 9:04 am
Posts: 2
Actually my assumption was wrong. I was thinking that the cause for this issue is Immutablity of the Entity A.
But this was happening because of the inverse attribute in the A.hbm.xml which has the value true.
But again I can't modify the value for inverse, as in my case, *hbm.xml files are autogenerated (with Andromda). And it seems andromda doesnt provide a good logical implementation for that. So I am saving the relationship from Entity B side now, which works.

Thanks for the help.

By the way, if anybody knows how to fix this issue with Andromda, please let me know.

Thanks.

Lal[/b]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.