Ok I understood. As Stefan suggested, I created an abstract test base. But since I really needed to query the TestBase table without many left joins, I introduced a stub class:
public class TestStub : TestBase {
This class is completely empty. Map:
public sealed class TestStubMap : SubclassMap<TestStub> { public TestStubMap() { this.Table("TestBase"); this.KeyColumn("Id"); } }
Now I can request:
var a = this.Session.Get<TestStub>(1)
It produces only one connection (TestBase join TestBase). So, now I can get my test base from db without overhead. I do not like hacks, but if the built-in logic does not work (polymorphism = explicit), what remains to be done.
source share