Note that you only get the old values if they have ever loaded into
the session. This is important when working with detached instances. I
had a hard time to figure this out and write the application that it
works.

 - Use Get or any query to get the instance into the session and
change properties
 - After changing a detached instance (eg. in the client), use Merge
to put it back into the session.
 - Using Save is always safe :-)
 - Update and SaveOrUpdate does not provide old values! (NH does not
need a DB roundtrip and just performs an update, the old value is
never retrieved.)


On 14 Jul., 20:47, Paulo Quicoli <[email protected]> wrote:
> thanks!!! I will try to implement that
>
> 2009/7/14 Belvasis <[email protected]>
>
>
>
> > Yes i wanted to write Post* sry :)
>
> > Am 14.07.2009 um 19:50 schrieb Fabio Maulo <[email protected]>:
>
> > Post* listeners
>
> > 2009/7/14 Belvasis < <http://belvasis.de>belvasis.de@<http://googlemail.com>
> > googlemail.com>
>
> >> The Pre* Event Listeners enable you to exactly do what you want. Since
> >> you will get the old and new values of the entities properties as
> >> parameters, you can easily save them using another entity.
>
> >> Am 14.07.2009 um 19:36 schrieb Paulo Quicoli < <[email protected]>
> >> [email protected]>:
>
> >> > Hi friends,
>
> >> > I´m needinng here an audit mechanism. But log will be persited in ot
> >> > her table. For example, if i change an object Order,
> >> > the log about old properties values and new old values will be in a
> >> > table "LOG"....
> >> > Doing some "google" i found a link from Ayend about
> >> > IPreUpdateEventListener and  IPreInsertEventListener.
>
> >> > Is there a way to use them to insert that log in other table... see,
> >> > i need to know what changed... not only date/time...
>
> >> > Also, googling... i didn't find anything about deleting events....
>
> >> > Thanks friends!!!!!!
>
> >> > --
> >> > Paulo R. Quicoli
>
> >> > Editor Técnico - ClubeDelphi Magazine - DevMedia
>
> > --
> > Fabio Maulo
>
> --
> Paulo R. Quicoli
>
> Editor Técnico - ClubeDelphi Magazine - DevMedia
--~--~---------~--~----~------------~-------~--~----~
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