Can I perform a global reverse check on objects managed by NHibernate?
In particular, I have a permanent class called "Io". There are a huge number of fields in several tables that could potentially contain an object of this type. Is there a way (based on a specific instance of an Io object) to get a list of objects (of any type) that really reference this particular object? (Bonus points, if he can determine which specific fields really contain the link, but this is not critical.)
Since NHibernate mappings define all references (and the underlying database has corresponding foreign key references), this should be some .
Imagine this structure:
class Io
{
public int Id { get; set; }
}
class ThingOne
{
public int Id { get; set; }
public Io SensorInput { get; set; }
public Io SolenoidOutput { get; set; }
}
class ThingTwo
{
public int Id { get; set; }
public Io SensorInput1 { get; set; }
public Io SensorInput2 { get; set; }
public SubThing Doohickey { get; set; }
}
class SubThing
{
public int Id { get; set; }
public Io ControlOutput1 { get; set; }
}
Io, , ThingTwo 12. , ThingOne 16. , , - SensorInput2, .