nhibernatewikiinput-history

Nhibernate and History Tables


I am working on a ASP.NET MVC website using Nhibernate as my ORM. The project is similar to a wiki/blog engine and requires that as pages are edited they store a history of the edits in another table which can then be viewed and recovered. This is complicated somewhat in that each "page" can have collections associated with it that can also be edited/added/removed. I would also need to stored these changes.

I was wondering how this fits into an entity mapping scenario such as Nhibernate and how this might be implemented. If anyone knows of any articles on this, or has done this themselves then please let me know.

I was considering triggers but I would prefer not to mix data access technologies if possible. I also am using MySql so CDC would not be possible for me.

Thanks


Solution

  • Either implement an auditing interceptor or use the event system. The event system is newer, I haven't found any auditing examples yet...

    Also see this related question: