Jose, Thanks a lot for your comment!
I'm not really interested in the id, I'd either use a reference to the actual object (as in: @event.Session.Save(new AuditRecord(@event.Entity))), or use the hilo id generator (as I believe is recommended). Anyway, this is not I'm interested in in my particular case. The other reason is more important IMO. I believe I should go the inheritance path and check for stuff like IsUpdateNecessary, right? ulu On 15 янв, 00:07, José F. Romaniello <[email protected]> wrote: > You just discovered that listeners are executed in order, so you are > on the right track to becoming a Pro. > Secondly, take care the following situations: > 1-if you need the id of the entity. > 2-if you change values of an entity that didn't change.... You will > force an update. > > I am not sure if this is your case but that the reason most of us dont do > that. > > 2011/1/14, ulu <[email protected]>: > > > > > Dearest All, > > > I published a blog post on automatic updates to the entity just before > > flushing it to the database. Such things are usually used for > > auditing, denormalization, ensuring database consistency etc. I > > believe that my approach is better than what I managed to google, but > > I don't understand that nobody else writes about it. If there are > > NHibernate pros among you, I'll be very grateful for any comments. > > > The post:http://dotfresh.blogspot.com/2011/01/flush-in-night.html > > > Thanks > > > -- > > 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. > > -- > Enviado desde mi dispositivo móvil -- 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.
