From reading the code and the tutorial I would assume, that inhertitance is supported by QxOrm. In my application I have the folowing inheritance hirarchy:
- Code: Select all
// the interface
class IContainer
{
}
// has some data related to all containers that may contain fluid
class CFluidContainer : public IContainer
{
}
// this is a leaf in the inheritance hierarchy that implements a real container
class CTank : public CFluidContainer
{
}
// that is a leaf in the inheritance hierarchy for storage of pipettes
class CPipetteContainer : public IContainer
{
}
Now in my application I need to work with the plain IContainer interface and I also need to work with the implementations (i.e. CTank). That means, I would like to read all containers from database into a container collection.
Is this possible with QxOrm. How is this implemented in the database? Does QxOrm create a table for each derived class? It would be create if the samples or the tutorial could be enhanced to show how to work with inheritance.
I tried the exe-dll1-dll2 test because it works with inheritance (CUser is derived from CPerson). But if I insert a CUser via qx::dao::insert(pUser) like it is done in the exe source then the CUser table contains 1 entry and the CPerson table is empty. So where is the data stored of the base class CPerson? Is there something I'm doing wrong?