[odb-users] multiple base classes

Boris Kolpackov boris at codesynthesis.com
Fri Aug 3 10:27:41 EDT 2018


MM <finjulhich at gmail.com> writes:

> class ELBase { ... };
> class EL { ... };
> 
> class Derived : public ELBase, public EL { ... };
> 
> #pragma db object(ELBase) polymorphic table("eqlogb") transient definition
> #pragma db object(EL) polymorphic table("eqlog") transient definition
> 
> #pragma db object(Derived) definition
> 
> Is this supported?

Section 8.2, "Polymorphism Inheritance", fourth paragraph:

"Note that multiple polymorphism inheritance or mixing polymorphism 
and reuse inheritance is not supported."


> In fact EL is a implementation helper, and while I use ELBase pointers and
> references, I don't access the objects via EL pointers and references.

Then you cat try to make EL a transient base and persist its data members
as if they were in Derived (using virtual data member).



More information about the odb-users mailing list