This is a mapping question. I have a two objects that get associated to each other via one of two possible tables. So, for instance, object A has a reference to object B via table X or via table Y. See the following picture:
A-----X------B
or
A-----Y------B
The property on A and on B is the same in both cases. The keys on the join table are composite keys as they are on both A and B. Additionally, A is actually polymorphic itself (either union or implicit). See the following picture:
A
^
|
------
| |
M N
Object types M and N are related to their own tables with A being an interface (no table to create the polymorhic relationship).
Right now, I have had to implement the join referecences as two properties on both M and N. Fortunately the condition which decides whether the association goes through X or Y is mutually exclusive. However, it is not a simple column, but a calculation.
Can anyone think of a way to implement/map this using the same property? Is there a way to use a formula in the join to determine which table to join with??
Thanx for your time,
LES
|