Can state be safely modified within an event listener or will that mess up the
executing flush? Are there any "gotchas"? Specifically, I would like to set
some properties on a mapped object and properties on a child collection
(one-to-many) from within the PerformSaveOrUpdate of a listener that extends
from DefaultSaveOrUpdateEventListener.
Example:
public class ProcessBeforeSaveOrUpdateListener :
DefaultSaveOrUpdateEventListener
{
protected override object PerformSaveOrUpdate(SaveOrUpdateEvent
@event)
{
var myEntity = @event.Entity as MyEntity;
if (myEntity!= null)
{
myEntity.MyProp = 1;
//will this mess the flush up, since
MappedChildCollection might not have been loaded or modified BEFORE this call?
myEntity.MappedChildCollection[0].SomeProp
= "something";
}
return base.PerformSaveOrUpdate(@event);
}
}
Thanks!
-tyler burd
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---