<<We would like the ability to generate an audit record when either the 
Description or Type changes and have the Hours included in the audit record; 
however, we do not want an audit record generated if only the Hours change. Is 
this possible?>>

AFAIK, no - not out of the box. However you could subclass Envers' 
AuditEventListener and override OnPostInsert, OnPostUpdate and OnPostDelete. 
There you check if "correct" attributes have changed - if you want to audit the 
entity, call base implementation, if not do nothing.
This instance you pass in to the IntegrateWithEnvers method.

Another alternative would be to track changes not only on entity level but on 
property level...
http://envers.bitbucket.org/#envers-tracking-properties-changes
...and use queries to get the audited info you want...
http://envers.bitbucket.org/#envers-envers-tracking-properties-changes-queries
...but I guess that's a bit of overkill for you.
(also; currently fluent configuration lack a bit of configuration here)



________________________________
Från: [email protected] [[email protected]] för David Keck 
[[email protected]]
Skickat: den 19 december 2012 15:30
Till: [email protected]
Ämne: Re: [nhusers] NHibernate Envers fluent interface and property tracking 
questions

Thanks for the response.  I apologize for not being clear in my communication.

By run time I mean:  We are planning on allowing the customer to decide what 
attributes of an entity that they would like to track for auditing.  It is 
acceptable to require that the session factory be re-created after this 
decision is made or after a change is made to decide what attributes are 
tracked.

As far as the "certain properties":  No they are not common across all of the 
audited entities.  Assume a simple entity with the attributes of Id, 
Description, Type, and Hours.  We would like the ability to generate an audit 
record when either the Description or Type changes and have the Hours included 
in the audit record; however, we do not want an audit record generated if only 
the Hours change.  Is this possible?





On Tuesday, December 18, 2012 4:10:46 PM UTC-5, Roger wrote:
1. What do you mean by "run time configuration"? You don't mean changing what 
properties to audit after the session factory has been created, right?
But yes, you are right. Fluent interface currently only support "exclusion 
model".

2. An entity and its audited counterpart share the same .net type.
What are these "certain attributes"? Are they common for all audited entities 
(eg like who did the change), if so - make your own revision entity.

________________________________
Från: 
[email protected]<https://webmail.teleopti.com/owa/UrlBlockedError.aspx> 
[[email protected]<https://webmail.teleopti.com/owa/UrlBlockedError.aspx>]
 för David Keck 
[[email protected]<https://webmail.teleopti.com/owa/UrlBlockedError.aspx>]
Skickat: den 18 december 2012 16:56
Till: 
[email protected]<https://webmail.teleopti.com/owa/UrlBlockedError.aspx>
Ämne: [nhusers] NHibernate Envers fluent interface and property tracking 
questions

We are looking at using Envers to audit several of our entities and I have been 
looking at the documentation and have two questions that I am hoping someone 
can answer:

1. It looks like the fluent interface for configuring entity auditing is an 
exclusion model where all of the mapped properties of the entity are audited by 
default unless a property is explicitly excluded.  We plan to do run time 
configuration of the audited properties based on information provided by the 
user and would prefer to have an inclusion model were we specify in fluent the 
fields to include.  So far it looks like this is not supported in the fluent 
interface.  Am I correct?


2. We have a requirement to always include certain attributes in the audit that 
are part of the entity being tracked, but we do not want changes to these 
specific attributes to trigger an audit record. In a sense they just come along 
for the ride and would load into the entity when we query with the AuditReader. 
 I see that the RevisionEntity can store additional information, but that does 
not seem to be the correct solution for us since I don't believe that the 
RevisionEntity information will load back into the entities property during the 
query.  Is there a straight-forward way to support this requirement with Envers?


Thanks for any guidance that you can provide.

--
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/OVi89ImRB4MJ.
To post to this group, send email to 
[email protected]<https://webmail.teleopti.com/owa/UrlBlockedError.aspx>.
To unsubscribe from this group, send email to 
[email protected]<https://webmail.teleopti.com/owa/UrlBlockedError.aspx>.
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 view this discussion on the web visit 
https://groups.google.com/d/msg/nhusers/-/Myp5CR8MTC0J.
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