Question

I want to implement something like change log with NHibernate.Envers. How I can achieve this in most elegant way? Suppose we have blog (name) and post (body, createdat) entities. Blog has many posts. I need to get history of blog changes:

modified: name changed from 'a' to 'b'
added post: body 'example', createdat 24.02.2013

modified: name changed from 'b' to 'c'
post modified: body changed from 'example' to 'sample'

Thanks.

Was it helpful?

Solution

In Envers, and I suppose NEnvers is the same, there isn't any specific support for this use case. You need to read the desired range of revisions of an entity (could be all), getting a list of historic entities and compare in-VM.

See also:

Getting modified properties by revision

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top