It's quite common practice in OOP languages to create a pointer typed as to a base class, and assign an address of an object of a derived class.
If we have objects' hierarchy (inheritance) in bpm`online, it seems logical to have also an ability to create lookup fields in 3rd objects which would refer to virtual base objects.
Sample: we have an "abstract" Object A containing some common properties ("columns"), this Object is virtual. We create several derivatives (B, C) which are "real" Objects based onto A, they are represented by tables in DB. Now we would like to create another Object D which would have a field a_id of type Lookup which would point to the "abstract" Object A. So, actually we want the D to point to B/C depending of a certain row.
I surely understand why it is impossible currently: foreign keys which correspond lookup fields obviously cannot be created for non-existing tables (virtual objects).
Technically, such "foreign keys" might be emulated with SQL triggers.
Obviously such a_id will not be joinable via ESQ (again, because there is no table to which a_id "refers"). It does mean a query like:
var esqQuery = new EntitySchemaQuery(/*...*/, "D");
esqQuery.AddColumn("a_id.Name");
would not make any sense. Although a query like:
var esqQuery = new EntitySchemaQuery(/*...*/, "D");
esqQuery.AddColumn("[B:Id:a_id].Name");
makes sense.
Please consider this idea as a proposal to make bpm`online be closer to developers who came from OOP. Thank you.