Global find object references in NHibernate
- by Miral
Is it possible to perform a global reversed-find on NHibernate-managed objects?
Specifically, I have a persistent class called "Io". There are a huge number of fields across multiple tables which can potentially contain an object of that type. Is there a way (given a specific instance of an Io object), to retrieve a list of objects (of any type) that actually do reference that specific object? (Bonus points if it can identify which specific fields actually contain the reference, but that's not critical.)
Since the NHibernate mappings define all the links (and the underlying database has corresponding foreign key links), there ought to be some way to do it.