This is what I am after (as described in documentation). Since I don't see IsUnsaved in the interface, and I think I read somewhere that IsTransient replaced it, I am trying to implement that. Is the documentation incorrect or my understanding of it?
Quote: "Since a composite identifier must be assigned to the object before saving it, we can't use unsaved-value of the identifier to distinguish between newly instantiated instances and instances saved in a previous session. You may instead implement IInterceptor.IsUnsaved() if you wish to use SaveOrUpdate() or cascading save / update. As an alternative, you may also set the unsaved-value attribute on a <version> (or <timestamp>) element to specify a value that indicates a new transient instance. In this case, the version of the entity is used instead of the (assigned) identifier and you don't have to implement IInterceptor.IsUnsaved() yourself." On Mar 19, 8:53 am, Fabio Maulo <[email protected]> wrote: > IInterceptor.IsTransient is not used for "transient" checking during Save > and SaveOrUpdate. > > 2009/3/19 epitka <[email protected]> > > > > > > > Ok, so now that I verified that I need to see why my interceptor is > > not being called. Very strange, I open a session and pass in > > interceptor via constructor. Interceptor inherits from > > EmptyInterceptor. That should be it, I guess. I should get a call to > > at least one of the methods, but I am not. So, I am going to have to > > do some NH debuging. > > > Thanks for your help Fabio. > > > On Mar 19, 8:27 am, Fabio Maulo <[email protected]> wrote: > > > 2009/3/19 epitka <[email protected]> > > > > > Ok, I'll look into it. But now I am intrigued why interceptor is not > > > > being called. I am just trying to understand how to implement > > > > interceptor. For intereceptor to work I don't have to override any > > > > listeners or? > > > > No you don't... but then you can know the IInterceptor limitations and > > its > > > life end there. > > > For something we have events/listeners > > > > -- > > > Fabio Maulo > > -- > Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
