views:

31

answers:

0

Hi

We have a large management application and we do alot of logging for every action, who did what and at what time. However we have more and more automatic systems which we would like to differentiate aswell.

In all our tables we have a column called PerformedBy which is an int. This has always been a reference to a Table called Employees which then have a corresponding Name.

However we would now like to have some system users (for instance online payment server, online booking and so on). We could of cause create these in the employees table however that seems incorrect and we wouldn't be certain of IDs (this is a commercial system, so we have 200 databases which would have to be updated.)

So what i would really like to do is make a mapping so that if an ID is positive it maps to an employee which is loaded from the database. If it is negative i would like to have some static classes which derive from Employee one for each type of system user.

Something like class OnlineBooking : Employee {

}

Is something like this possible with NHibernate or does someone have another great solution ? I would like not to add additional columns to ALL the tables that have logs.