I'm implementing automatic auditing on an app I'm working on and I'm
having a problem getting the PostUpdateEvent listener to fire when I
change a property which is mapped as a HasManyToMany.

Below is my map.  If a change is made to any of the properties other
than "AdministersUnit" the PostUpdateEvent Listener is fired on the
update.
If I change more than one property and AdministersUnit the postupdate
still doesn't pickup that AdministersUnit has changed.   I've just
tried it with a PreUpdate event listener and the same behaviour is
there.
NH is generating a table between the two entities to handle the many
to many relationship and it's changes to this table that aren't being
picked up on.   Has anyone seen this problem, do they have a
workaround?


    public class UserMap : ClassMap<User>
    {
        public UserMap()
        {
            Id(x => x.Id);
            Map(x => x.UserName).Not.Nullable().Length(50);
            Map(x => x.Name).Length(100);
            Map(x => x.Email).Length(100);
            References(x => x.Unit).Nullable();
            Map(x => x.IsAdmin).Default("'false'");
            Map(x => x.WarningMessagesOn).Default("'true'");
            HasManyToMany(x => x.AdministersUnit).LazyLoad();
        }
    }

Cheers

Rob

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