Hello,
I've been digging through the docs and forum for a while and could use some clarification on an issue. I have a situation where a single domain class may implement several interfaces. Its relationship to other domain classes is through those interfaces (e.g. class Car may implement both IVehicle and IAsset. The class CarPool has a reference to an IVehicle and the class AssetList has references to IAsset. these are just an example btw). Additionally, there are several classes implementing IVehicle and IAsset. I am having trouble figuring out how to define the mappings such that if I ask nHibernate to load an instance of CarPool, it loads any mapped IVehicle regardless of implementation type. Same for AssetList. I looked at the <any> mapping which seemed promising, however, the documentation says
Quote:
It is impossible to specify a foreign key constraint for this kind of association, so this is most certainly not meant as the usual way of mapping (polymorphic) associations. You should use this only in very special cases (eg. audit logs, user session data, etc).
Is there a more usual way to support this kind of mapping? I have not been able to find anything in the forum or docs.
Looking forward to your responses and thanx for your time.
Jay