.NET ORM Framework with data versioning (Slowly Changing Dimension Type 2)?

谁说我不能喝 提交于 2020-12-14 23:46:04

问题


I am building a .NET application for inserting data (an Excel add-in in fact), and I want to use an ORM for inserting data with automated versioning.

Here's a worked example:

  • User "John Doe" does the first data insertion (4 data points as per below example)
  • At a later time, user "Albert" opens the interface, modifies one data point, and saves
  • All 4 data points are processed; ORM flags the modified data as non-Current, adds the new data, updates version counter, changes validity dates columns

I am looking for an ORM framework that would automatically take care of the versioning. Below, the database table after the second insertion. Those familiar with DB schemas will recognize this as a "Slowly Changing Dimension (SCD) Type 2"

The data will be accessed not via the ORM, but from various SQL queries, so the valid_from/valid_to columns are essentials. I am also aware that this can be done with database triggers but I want a solution that works regardless of back-end...


回答1:


Finally found something.

NHibernate has a versioning extension, Envers.

http://www.primordialcode.com/blog/post/nhibernate-envers-quick-introduction

It will create both last-version tables and versioned tables. It won't call it a "Slowly Changing Dimension", but the versioning strategy is equivalent (as opposed to creating a table for each measure to version)

Schema below.



来源:https://stackoverflow.com/questions/61372560/net-orm-framework-with-data-versioning-slowly-changing-dimension-type-2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!