My mistake. The PostCollectionUpdateEventListener works fine (once you add
it as a listener to the config -- doh!)
On Wednesday, January 30, 2013 1:33:28 PM UTC-5, Trinition wrote:
>
> Did you ever find a solution? I find myself desiring the same thing.
>
> I tried what *jwdavidson* said -- use a PostCollectionUpdateEventListener
> -- but it didn't work for me.
>
> On Tuesday, October 19, 2010 5:38:13 AM UTC-4, RobB wrote:
>>
>> 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 unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.