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
0
votes
1 answer

Envers and batch loading scripts

I originally loaded some data through a liquibase script, and this has resulted in the envers audit table missing the insert records. So while I have update records, I do not have original insert records I've written a data script to reinsert this…
farrellmr
  • 1,815
  • 2
  • 15
  • 26
0
votes
1 answer

Hibernate Enver : @AuditJoinTable rows missing

Given an Entity that is audited by Envers, which contains one collection. Entity A @Audited public class A{ @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private int id; .... @OneToMany @JoinColumn(name =…
0
votes
1 answer

Hibernate Enver : @AuditMappedBy is not working

I created an instance of A, defined name, with a blank collection of entities B and save it into DB. This is revision #1. Now I use the following statement to get all initial revision of class A //Get revisions A a = auditReader.find(A.class, aId,…
0
votes
0 answers

Hibernate Auditing Generate Events when particular filed is updated or created

I want to record a event as soon as Status is updated/created. Right now I am using JPA, AbstractAuditEvent, IDiffEvent events for generating events where it I am successfully able to log complete entity information like Case create event and…
ssl
  • 115
  • 1
  • 10
0
votes
1 answer

How to setup batch fetching for history entities using nhibernate.envers

Can one setup batch size for fetching as per 19.1.5 (http://nhibernate.info/doc/nhibernate-reference/performance.html#performance-fetching-batch) only for historic entities? I cannot find an option, but maybe someone ever stumbled upon this problem…
ceaggregation
  • 195
  • 12
0
votes
1 answer

Nhibernate envers modified columns doesn't correctly track removals from collection

I've got a model that looks like: class Case { public virtual ISet CaseTags { get; set; } public virtual DateTime LastModified { get; set; } } class CaseToCaseTag { public virtual Case Left { get; set; } } When auditing…
aeliusd
  • 469
  • 7
  • 18
0
votes
1 answer

NHibernate Envers ValidityAuditStrategy -- what am I doing wrong?

I have the following configuration to set NH and Envers up: var properties = new Dictionary(); properties[NHibernate.Cfg.Environment.Dialect] =…
Michael
  • 1,351
  • 1
  • 11
  • 25
0
votes
2 answers

Envers generating audit-table schemas with all varchars length 1

I'm experimenting with Envers. I've got it working okay, except that when it generated the audit table for my audited entity it made all the varchar columns length 1, rather than the length of the corresponding column in the base table. Like…
Michael
  • 1,351
  • 1
  • 11
  • 25
0
votes
1 answer

Adding a comment to NHibernate Envers Revision Entity

I've got basic Envers working, and I understand how to get something like the name of the calling User into the Revision Entity, since that's effective static data. But how do I add a comment created dynamically by the user for a given revision? I…
Michael
  • 1,351
  • 1
  • 11
  • 25
0
votes
1 answer

Fluent Configuration Exception

if (_cacheSessionFactory == null) { Configuration config = null; _cacheSessionFactory = ReadOrBuildConfiguration().ExposeConfiguration( cfg => { SetSessionContext(cfg); …
0
votes
0 answers

Hibernate Envers @ElementCollection on List java

I want to use @ElementCollection on a set of type List, like this: @ElementCollection @CollectionTable(name = "MY_PRODUCT", joinColumns = @JoinColumn(name = "ID_PRODUCT")) private List products = new ArrayList<>(); After that, I see…
Aron
  • 1,142
  • 1
  • 14
  • 26
0
votes
1 answer

How to query audit table with many-to-many relationship

I have an entry class with a many-to-many relationship with a tags class. I'm trying to restore a historical copy of an entry. I've tried querying like this: AuditReader reader = AuditReaderFactory.get(getEm()); var entryRevision =…
ryan
  • 1,451
  • 11
  • 27
0
votes
1 answer

nHibernate Envers Get history record for deleted revision

I store entity changes in database using Envers. I configured StoreDataAtDelete parameters to true and is works fine. Database contains history data. However, when I try to query audit data to get historical record state for deleted revision, I get…
suvroc
  • 3,058
  • 1
  • 15
  • 29
0
votes
1 answer

using revision tables to store business data?

we use Hibernate Envers in our project to store a complete revision of all our database tables. Would you advice to use these shadow tables for the retrieval of business data (e.g. creationDateTime/modificationDateTime/business "history" of an…
0
votes
1 answer

hibernate envers: get modified entities for current revision

In the current transaction, before committing, I want to see all changes for the current revision. I can get the current revision by doing : auditReader.GetCurrentRevision(true) The modifiedBy and revision number are correct.…
Sam
  • 13,934
  • 26
  • 108
  • 194