-->
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: How to set cascade on an "inherited" <list> (composite)
PostPosted: Thu Feb 09, 2012 5:14 am 
Newbie

Joined: Thu Feb 09, 2012 3:30 am
Posts: 2
I have successfully made a "composite pattern" mapping and I use "one table".

Everything works when I have 1 baseclass, 1 composite subclass, 1 leaf subclass.

But ...

When I try to subclass the composite subclass like this ( I just show the relevant things):

<CODE>


class CompositeA : Base { ... public virtual IList<Base>Children ... }

class CompositeB : CompositeA { ... public override IList<Base> Children ... }

<MAP>

<subclass name="CompositeA" discriminator-value="A">
<list name="Children" cascade="all-delete-orphan">
<key column="ParentId"/>
<index column="ChildIndex"/>
<one-to-many class="Base"/>
</list>
</subclass>

<subclass name="CompositeB" discriminator-value="B">
</subclass>

Nhibernate does not complain in anyway and in memory everythingsfine though CASCADE does not work for Children of instances of CompositeB !!! If I explicit Save children of CompositeB instances before I put then in the list it works but that is not an option for med.

So the question HOW do I declare cascade="all-delete-orphan" for subclass CompositeB ?

If anyone know please help!

Regards
Magnus

I


Top
 Profile  
 
 Post subject: Re: How to set cascade on an "inherited" <list> (composite)
PostPosted: Mon Feb 13, 2012 10:29 am 
Newbie

Joined: Thu Feb 09, 2012 3:30 am
Posts: 2
Thanks for you answer.

I did not mean "composite id" though.

Regards
Magnus


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.