Nhibernate has a nice feature, which I have discovered coincidentally:
public interface IInterface {}
public class Impl1 : IInterface {}
public class Impl2 : IInterface {}
ISession session = sf.OpenSession();
session.QueryOver<IInterface>().List();
This will fetch me all Impl1
ans Impl2
objects (in case those classes are mapped). They need not be mapped as SubClassMaps
, which leads me to the conclusion that NHibernate resolves the implementing classes all by itself.
Can anyone send me the link to documentation on this one? I know neither the name nor the technical background of this feature...
Thanks in advance!