Rune Juhl-Petersen
Rune Juhl-Petersen

Reputation: 88

Mapping a property to another table using NHibernate

I have a users table that is updated by other systems. I have mapped the table to my users objects and that work great. As user data is owned by another system I don't want to change the structure of that table.

I want to add metadata to the user objects, but without changing the structure of the users table. I want to add a flag that tells me whether the user is an administrator or not. I think this flag could be stored in a table that only has one column which is the id of the user. whether a matching row is present would be represented as a boolean property on the user.

Is it possible to map this in NHibernate? I would like it so that I can update this directly through NHibernate.

Upvotes: 3

Views: 2314

Answers (1)

DanP
DanP

Reputation: 6478

You should investigate the <join> mapping, usage is described in this article.

Upvotes: 4

Related Questions