[odb-users] odb persistence in a library

Christian Sell christian at gsvitec.com
Wed Sep 30 12:44:37 EDT 2015


Hello,
 
still working on the "persistence in library" subject. Here's a problem I
encountered during my first test run:
 
we have an abstract, polymorphic superclass that is mapped inside the library.
Now we want to allow the user of the library to extend the object model by
adding new subclasses, which should also be made persistent AND be accessible
through the same polymorphic relationship. Graphically:
 
Library
    Class1 polymorphic
       id
       name
 
     Class2 extends Class1
 
    Class3
       id
      vector<Class1> poly_container
 
LibraryUser
     Class4 extends Class1
 
 
this immediately fails during odb compilation of the LibraryUser files, because
odb complains that Class4 does not designate an object id. The reason is obvious
- odb doesn't know that Class1 has been mapped polymorphically elsewhere. Can
this situation be solved somehow?

thanks,
Christian



More information about the odb-users mailing list