I have a situation where I have table "a" representing class type "A", table "b" representing class type B, derived from A, and table "c", representing class type C, also derived from A. So, from an object perspective, it seems simple "B and C are derived from A"
For some reason, the original developers have seen fit to allow rows, with the same identifier, in B and C, at the same time. So rather than the expected situation where an instance of "B" causes rows in b&a, or and instance of "C" causes rows in c&a, i have situation where there can be rows in a,b,c, all for the same object. From the point of view of objects, it seems that an instance can be both "B" and "C" at the same time.
I've currently mapped this with B and C being <joined-subclass> of A. However, NHibernate seems to get confused and throw "WrongClassException" when trying to fetch instances.
Is there a better mapping I could chose? I don't imagine that this type of problem is unique to me; has anyone else run into it?
|