tags:

views:

67

answers:

0

Hi all,

We have the following Database design. As you can see, there is non normalized between the main tables ("ACCOUNTS" and "CONTACTS") with "NOTES".

How we can get a collection of "Notes" for the 2 main tables based on this DB design within NHibernate? We don't have the option to modify the existing DB design.

ACCOUNTS (considered 1): AcountID int, AccountNo text

CONTACTS (considered 2): ContactID int, ContactName text

NOTES: NoteID int, EntityID int (1: ACCOUNTS, 2: CONTACTS), EntityRowID int (An AcountID or ContactID), Note text