Oops.  I believe on my last post I hit "Reply to Author".

Ben,
Thanks.  That worked.  I just had the "many-to-one" side of the
relationship messed up in the child object mapping.

Evan,
I do have cascade="all".  The problem was with some of the other
settings.  Thanks for the reply.

I'm having one last problem.  If I call SaveOrUpdate on an existing
parent object and remove one of the child objects from the child
collection on the parent object, that child doesn't get deleted from
the database.  Do I need to call an explicit "delete" on that child?
Why would an update on the Parent pick up adds or updates to the
children through the collection, but not deletes?

Thanks,
Whitney

On Sep 4, 8:33 am, csharphacker <[EMAIL PROTECTED]> wrote:
> Hi Whitney,
>
> I'm curious to see how your mapping of the one-to-many was achieved?
> I was having some issues when i didn't use the cascade="all" option on
> the mapping of my one-to-many's (I'm kinda new too, but ran into a
> similar issue)
>
> you may be able to do a cascasde="save-update" as well, i'm not sure,
> for my testing I defaulted to using "all" and it fixed the issue.
>
> Regards,
>
> Evan
>
> On Sep 3, 11:10 am, Whitney <[EMAIL PROTECTED]> wrote:
>
> > Hi,
>
> > Any help with this issue would be appreciated.
>
> > If you have parent/child classes and the IDs are populated by a
> > sequencer, how do the children get the correct parent ID on an insert
> > of parent and children if the parent ID hasn’t been generated by the
> > time of the session.SaveOrUpdate(parent) call?
>
> > My child map contains the parent id as a property:
>
> > My parent map references the child as a one-to-many relationship:
>
> > Am I missing anything? The insert for the child always fails because
> > the Parent ID is left as a 0 and referential integrity is violated in
> > the database.
>
> > Thanks,
> > Whitney

--~--~---------~--~----~------------~-------~--~----~
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