Questions tagged [nhibernate-envers]

Powerful audit trail integrated with NHibernate

Envers adds powerful audit trail capabilities integrated with NHibernate.

Questions that address one or more of these features are a candidte for this tag

  • Auditing of all NHibernate mappings
  • Auditing custom types and collections/maps of "simple" types (strings, integers, etc.)
  • Logging data for each revision using a "revision entity"
  • Querying historical data

NuGet
Poject site

62 questions
12
votes
5 answers

How to access AuditReaderFactory in spring boot application?

I am using spring boot and spring data jpa. I am also using hibernate envers and I need access to AuditReaderFactory so that I can write Audit Queries. Since, its a spring boot and spring data jpa, everything is auto configured. So when I do this,…
ajm
  • 12,863
  • 58
  • 163
  • 234
5
votes
1 answer

nhibernate envers: auditing an entity already in production

We have an application that is already in production and it is using Envers to do auditing. Now we are going to release an update in which we audit a new kind of entity. However this entity already exists in the production environment, only it was…
Sam
  • 13,934
  • 26
  • 108
  • 194
4
votes
1 answer

How to log current user with NHibernate Envers

I've looked around how to log the username of the current user in the revision entity table of Envers. However, there's little information and the information I did manage to find wasn't that helpful. I have a revision entity and listener which…
Pieter
  • 3,339
  • 5
  • 30
  • 63
4
votes
1 answer

Configure an Envers RevisionListener via DI

To add an audit trail to our application we decided to use NHibernate.Envers. To allow app specific tracking of revisions, the DefaultRevisionEntity was extended with user specific data. public virtual void NewRevision( object revisionEntity ) { …
Andreas
  • 5,251
  • 30
  • 43
3
votes
2 answers

c# return named tuple from linq join

i'am trying to perform a join between a revision entity from nhibernate envers and a list with user names. i want to return a list of named tuples. this is my code public IEnumerable<(Societa company, DateTime datetime, string userName)>…
gt.guybrush
  • 1,320
  • 3
  • 19
  • 48
3
votes
1 answer

RavenDB 4 - change timestamp of revision

I'm planning to move from SAP SQLAnywhere + NHibernate + Envers to RavenDB4. I'm doing some migration and performance tests. At this time, I'm looking for an way to migrate Envers Audit to Raven revision. What I'm trying: Read source audit…
Zote
  • 5,343
  • 5
  • 41
  • 43
3
votes
1 answer

NHibernate Envers: Auditing entity based on property value

I have a very specific need for auditing. Consider the following class (I changed the name of my classes and trimmed unnecessary code for the sake of simplicity) [Audited] public class Client { [NotAudited] public virtual IList Orders…
Sam
  • 13,934
  • 26
  • 108
  • 194
3
votes
1 answer

Auditing user using NHibernate Envers fluentconfiguration

I am trying to use NHibernate Envers to log an additional field "user". I have followed several code examples that seem to vary a bit when it comes to syntax, probably because some of them are a bit out of date. However I can't get it to work. I'm…
ds99jove
  • 618
  • 2
  • 7
  • 21
3
votes
1 answer

How to swap unique, ordering column entries with NHibernate and Envers?

I am working with NHibernate for a while now and finally hit a problem, I can neither find an answer, nor anyone else how seemed to have this problem. The environment is NHibernate 3.3.1.4000 and NHibernate.Envers 1.4 for history keeping. I've got a…
JokoFacile
  • 143
  • 5
2
votes
1 answer

Query revisions where properties were modified and select a flag if property was modified

I have the following class public class Product { public virtual int Id { get; set; } public virtual double Price { get; set; } public virtual string Description { get; set; } } The audit table looks like this CREATE TABLE Product_AUD…
NePh
  • 966
  • 9
  • 21
2
votes
1 answer

Nhibernate envers, use dependency injection to add user into revision entity

after reading this and this i come near solution but not to the end since i miss how to apply to my implementation. i have this custon revision entity and revision listner: public class _NHRevEntity : DefaultRevisionEntity { public virtual int…
gt.guybrush
  • 1,320
  • 3
  • 19
  • 48
2
votes
2 answers

Add OR condition to query

I am wondering how it is possible to add an OR condition to the Envers criteria api: public IEnumerable GetHistory(object id, params string[] props) { var auditQuery = AuditReaderFactory.Get(Session).CreateQuery() …
core
  • 851
  • 1
  • 8
  • 28
2
votes
1 answer

UTC timestamps for NHibernate Envers revision info

I'm using NHibernate Envers 1.6.0 and need to use UTC timestamps instead of local for the REVTSTMP column in REVINFO. I know the bug has been reported (NHE-122) and fixed for future version 2.0 Is there any way I can change the…
Mike737
  • 836
  • 5
  • 16
2
votes
1 answer

Windsor 'Scope cache was already disposed' within Envers custom Revision Listener

Update: I think is down to a Windsor configuration, does any one have any idea as to what I have not configured correctly with Windsor? I am currently using Envers within a C# WebApi project. Windsor is used for IoC. I have a custom RevisionEntity…
2
votes
2 answers

nhibernate validator and envers together

I am trying to use both nhibernate validator and nhibernate envers together in the same project.... but i am getting the null expection: If i iniitliaze the validator later, i get the error: Mesage: Object reference not set to an instance of an…
user2165424
1
2 3 4 5