orm - Table-agnostic Foreign Keys? -


First of all, I had read, so I do not have to point it towards it.

I am working on a problem similar to that, I have a database with an auditing table that is used to store auditing information about other tables within the DB. The basic form of this table is:

ID, EntityID, EntityTypeID, ActionTypeID, DateTime

Now, as you can guess, the general nature of EntityID means that the foreign key The relationship and this table are very difficult to manage, especially in the mix of an ORM system with you.

Of course, the solution of scruffy work is to manually make the necessary questions and use the ORM stuff where it works, which I am fine.

However, this issue raised the question in my mind whether there is any RDBMS available, which allows the foreign key relationship of the form: Table: ID is to be defined.

In other words, in such RDBMS, the EntityTypeID column may contain values ​​such as

'TableA: 1' and 'TableB: somekey'

So ...

Is there any RDBMS that does this? Audit tables can not usually lack lack of integrity referenced on them.

An audit table, A, information about a line of data, R, is a series of records for some table, T, and R, each representing each R at a different time. When R is modified later, the information given in A. does not change, and R is not allowed to stop the change. When R is removed later, the presence of audit records in A is not allowed to stop that extinction.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -