In a nutshell, people get email invitations to fill out review forms and
there's a rather bizarre requirement that they always 'see' the form as
it was at the moment the invitation was created, regardless of what's
changed since.  To achieve this, we're recording an Envers version in
the 'invitation' entity and then using the IAuditReader to pull out the
object graph as it was at that revision - the basics of this work
remarkably well considering that this isn't Enver's basic design
intention.

The problem we're facing is that a few of our entities have (transient)
properties needed for the domain logic injected into them with
context-specific information by an NHibernate interceptor (a trivial
example would be the current user).  However, Envers reads the entities
as maps rather than POCO's and so the interceptor isn't able to do this
for the versioned entities.  Looking over the Envers code, admittedly at
silly-o'clock this morning, made me think that we could tweak
MapToEntityFromMap to do the injection.

Pseudo-code:

class MyEntity {
        Id {get; protected set; }
        Name { get; set; }
        [DependencyAttribute]
        Context { get; set; }           // Injected by interceptor
}

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Roger Kratz
Sent: 20 November 2012 12:37
To: [email protected]
Subject: [nhusers] RE: Envers - custom IIdMapper implementation?

I don't think it's currently possible.

Why do you want to do this? What do you want to accomplish?

-----Original Message-----
From: [email protected] [mailto:[email protected]] On
Behalf Of Pete Appleton
Sent: den 20 november 2012 13:08
To: [email protected]
Subject: [nhusers] Envers - custom IIdMapper implementation?

Hi,

We're wanting to use a custom IIdMapper in our Envers setup, but haven't
found the extension point to configure it; any pointers please?

Thanks,

Pete

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

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

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