[odb-users] Help, how to generate the hxx files automately by odb

Boris Kolpackov boris at codesynthesis.com
Fri Mar 1 07:32:43 EST 2013


Hi Hugo,

Hugo.Mildenberger at web.de <Hugo.Mildenberger at web.de> writes:

> Below is a proof of concept of this idea. odb generated the database access 
> code for a C++ class named "telecom", which tries to accesses a table of
> the same name. Now the very same code runs db->persist(telecom), 
> db->update(telecom) and db->erase(telecom) without a problem also on a 
> view having a trigger procedure attached. I'm interested to know what 
> you think about this approach ...

I don't see anything wrong with this as an example of mapping a C++
class to a custom (existing) schema.

At the same time, if we are talking about automatically generating
C++ classes from the database schema, then this would be a good example
why some (including myself) think that we could be opening a big can of
worms ;-). 

Specifically, I don't see ODB being able to figure out what's going on
in this example: i.e., that there is an "updatable" view of two tables
and that it should map this view to an object instead of mapping the
other two tables to two separate objects. ODB can't yet read someone's
mind ;-).

Boris



More information about the odb-users mailing list