The answer for fluent NHibernate is here: https://github.com/jagregory/fluent-nhibernate/issues/56, an extract:
Many-to-any support
We still don't support many-to-any
How the many-to-any is working could be in detailed observed here: Ayende, NHibernate mapping, many-to-any
But the most important information could be found here: 6.10. Heterogeneous Associations
The
<many-to-any>
and<index-many-to-any>
elements provide for true heterogeneous associations. These mapping elements work in the same way as the element - and should also be used rarely, if ever.
NOTE: Please, try to re-think your model. My experience is that the simplification from any but short perspective wins. Other words, If we have a class like Tag
, which could be referenced almost anywhere... usually we do not introduce IList<A> A
, IList<B> B
.. into Tag
itself. But we still can find the Tags related to A... with some querying