[odb-users] ODB exception on insert (ODB 2.4.0)

Craig Burton rccraigb at gmail.com
Tue Jun 9 17:27:18 EDT 2020


Thank you for looking into this, Boris.

I am able to work around this issue with only a little effort, I just
wanted to make sure I was attempting to do it correctly.

Thank you (and others at Code Synthesis) for a fantastic product!

Craig

On Mon, Jun 8, 2020 at 6:42 AM Boris Kolpackov <boris at codesynthesis.com>
wrote:

> Craig Burton <rccraigb at gmail.com> writes:
>
> > I am encountering the following exception upon attempting to insert a
> > derived class that inherits from two classes, one defined as polymorphic,
> > the other as abstract: [...]
>
> I've checked and this bug is still present in 2.5.0.
>
> However, before fixing it, we would need to understanding whether
> mixing the two inheritance styles is even something that makes
> sense and that we want to support. And the answer is likely "no"
> (this stuff is already complex enough).
>
> You can also achieve what you (probably) want with a transient base
> and a virtual data member:
>
> //#pragma db object transient
> class AbstractBase
> {
>    ...
>
>    std::string mAbstractBase;
> };
>
> #pragma db object
> class PersistentDerived
>   : public PersistentBase, AbstractBase
> {
>    ...
>
>    #pragma db member(mAbstractBase_) virtual(std::string)
> access(mAbstractBase)
>
>    std::string mDerived;
> };
>
>


More information about the odb-users mailing list