[odb-users] multi-file schema?

Christian Sell christian at gsvitec.com
Mon Sep 21 08:01:58 EDT 2015


Hello,
 
I am trying to map a schema that is distributed over several header files. Right
now I have one central application header which #includes a library header file.
There is one class from that library header file which I want to map:
 
main.h
   LocalObject
  #include <library.h>
        LibraryObject
 
now, since I cannot modify the library code, I am using a pragma-only epilogue
file, which looks like:

#include "main.h"
#include "library.h"

#pragma db model version(1, 1)
#pragma db object(LibraryObject)
#pragma db member(LibraryObject::name)


I am invoking odb with the following command line: 

odb --std c++11 -x -fPIC -d sqlite --generate-query --generate-session
--generate-schema --changelog changelog --schema-format separate --schema-name
flexis --odb-epilogue-file pragamafile


as a result I get a main_odb.cpp file which #includes a non-existent
"library_odb.h" file and an empty schema

Question: does ODB support mapping classes from different headers into one
common schema? If yes, how? What am I doing wrong?

thanks,
Christian



More information about the odb-users mailing list