Let NH generate your DB and then see the difference ;)

2009/4/6 graphicsxp <[email protected]>

>
> Thanks. But it's driving me nuts...
>
> I've added on-delete "cascade" and I also have the inverse=true but I
> still get as many DELETE as they are items to delete.
>
> In my Post mapping file :
>
>   <bag  name="Comments" inverse="true" cascade="all-delete-orphan"
> lazy="true">
>      <key column="PostID" on-delete="cascade"/>
>      <one-to-many class="Metrica.CommentPost, Metrica" />
>    </bag>
>
> In my Comment mapping file :
>
> <many-to-one name="thePost" class="Metrica.Post, Metrica"
> column="PostID" not-null="true" />
>
> Is there something wrong with what I'm doing ?
>
>
>
>
>
> On 6 avr, 16:21, Fabio Maulo <[email protected]> wrote:
> > on-delete="cascade" (attribute of <key> tag)and/or check the inverse.
> >
> > 2009/4/6 graphicsxp <[email protected]>
> >
> >
> >
> > > Hi,
> >
> > > If I remove all the items in my collection and saves my entity to
> > > which the collection belongs, I get one DELETE query per items.
> > > How can I have all these items deleted with the same DELETE query
> > > using something like :
> >
> > > DELETE FROM myTable WHERE id IN (1, 2, 3 , ... )
> >
> > > Thanks
> >
> > --
> > Fabio Maulo
> >
>


-- 
Fabio Maulo

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to