[odb-users] inheritance and derived class transient members

MM finjulhich at gmail.com
Wed Aug 26 16:21:28 EDT 2015


On 25 August 2015 at 12:18, MM <finjulhich at gmail.com> wrote:

>
>
> On 24 August 2015 at 14:59, Boris Kolpackov <boris at codesynthesis.com>
> wrote:
>
>> Hi,
>>
>> MM <finjulhich at gmail.com> writes:
>>
>> > struct Derived : public cloneable<Base,Derived> {
>>
>> You derive via cloneable which is not a persistent class.
>> As a result, all its bases (persistent or not) are also
>> ignored. So you will need to add something like this to
>> make your example work:
>>
>> using DerivedBase = cloneable<Base,Derived>;
>> #pragma db object(DerivedBase) abstract definition
>>
>> Boris
>>
>
> using or typedef both trigger the crash that you have fixed in this commit:
>
>
> http://scm.codesynthesis.com/?p=odb/odb.git;a=commit;h=15995637f9cab6a4d92a2383e2afdba2b48d5f7b
>
> Can you think of a workaround to avoid the crash until I get the next
> release of odb?
> If not, I'll try to rebuild new packages for fedora
>
> Thanks Boris,
>

Also,

if the id member is defined in Base, and several Derived classes, each with
a different table (repeating the columns from the base) that has a id
column, would the different Deriveds have different id spaces, or the same
one.
ie, can Derived1 have id 5 for e.g., and Derived2 also have id 5, given
that the id member is defined in the Base class?

Thanks,


More information about the odb-users mailing list