-->
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: Simple problem with aggregation
PostPosted: Thu Nov 23, 2006 7:03 am 
Beginner
Beginner

Joined: Tue Oct 05, 2004 5:15 am
Posts: 23
I have a class X persisted with hibernate which contains a "strategy" - for which there are three or four concrete implementations. Each is also persisted by hibernate (using joined-subclass).

Now, the strategy should live only as part of X.

We cant seem to be able to work out which type of mapping between X and its strategy to use (or if its even possible at all) such that if we set a new strategy on X, its old strategy is automatically deleted.

At the moment we are having to explicitly cater for a change, and manually delete the previously referenced object.

Could anyone shed any light on whether what we are trying to do is possible - and if so give any tips on how we could go about it?

Cheers,

Dave


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 23, 2006 8:35 am 
Senior
Senior

Joined: Sat Nov 27, 2004 4:13 am
Posts: 137
I'm not sure, but I believe there is no way to do the thing, but you can use a many-to-one or one-to-one instead of components to get it done.

_________________
don't forget to credit!

Amir Pashazadeh
Payeshgaran MT
پايشگران مديريت طرح
http://www.payeshgaran.co
http://www.payeshgaran.org
http://www.payeshgaran.net


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.