[英]Maintain Table History with Nhibernate
I have a situation where I have to maintain History of a table. 我必须维护表的历史记录。
For Eg: I have PaymentTransaction Table and I want to keep PaymentTransactionHistory for auditing purposes. 例如:我有PaymentTransaction表,并且我想保留PaymentTransactionHistory以便进行审核。
Do we have anything in NHIbernate that can be used to achieve this. 我们在NHIbernate中有什么可以用来实现这一目标的。 I read about IInterceptor and Events and couldn't really understand if they could be of any use in my case.
我读了有关IInterceptor和Events的文章,但我真的不明白它们是否对我有用。
I am using Fluent NHIbernate. 我正在使用Fluent NHIbernate。
Many Thanks 非常感谢
NHibernate Envers也可能是您的选择-但可能对您提到的用法有些过高 。
In my project this is done by an interceptor, using following methods: 在我的项目中,这是由拦截器使用以下方法完成的:
Just try them, it's not difficult. 只需尝试一下,这并不困难。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.