Global find object references in NHibernate

Posted by Miral on Stack Overflow See other posts from Stack Overflow or by Miral
Published on 2010-03-09T00:42:55Z Indexed on 2010/03/09 1:06 UTC
Read the original article Hit count: 358

Filed under:
|
|

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.

© Stack Overflow or respective owner

Related posts about nhibernate

Related posts about .NET