(Sorry if this is re-posted, the first attempt is acting weird)
I'm having some trouble getting NH to persist my object graph.
I have (something like) this:
class/table Parent
{
List<Event> Events; //Inverse
//Denormalized bit
Event LastEvent; //not inverse
}
class/table Event
{
not null Parent Parent; //Makes the association up there Inverse
}
I'm creating a new Parent, creating a new Event, adding the new Event
to Parent.Events and setting Parent.LastEvent to the new Event.
When I tell NH to save the Parent I get an error about a transient
object needing to be saved first. I assume its because the association
between Parent and Event is not clear.
The way the SQL needs to go is to insert the Parent with a null
LastEvent, then insert the Event, then update Parent.LastEvent.
I'm digging through my NHibernate in Action book now but if anybody
has a hint to point me in the right direction that'd be great.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---