tags:

views:

39

answers:

3

I don't know if there is a specific name for this, but I am designing an application backed by a database in which rows need to be immutable (not sure if that term applies here, but it is the closest to describing what I need). That is, instead of changing the data stored in a row, a new row would be inserted with the same id but a different primary key. There would be some metadata stored with row that would indicate which is the most current row for that id, and whether the record with that id has been "deleted". I would like to use an ORM in which I could use normal insert, update, delete statements, but would do all that in the background. Since I don't know what terminology to use, I am having a hard time finding a solution using the great, all-knowing Google. Does an ORM like this exist, or would I have to build one / modify an existing one? Any tips are appreciated.

A: 

Maybe this might be asolution?

http://docs.jboss.org/envers/docs/index.html

Steven Verborgh
+1  A: 

You could use any ORM that supports stored procedures, then write sprocs to perform the updates.

SLaks
+1  A: 

What you might be looking for is a temporal database pattern whereby saving each item creates a new version. The idea behind temporal databases is that you can essentally query the data as it was at a given date.

Hatch