You'll need refection
Your replacing the reflection that hibernate uses to map classes to the database (with help of mapping file) with a code generator that generates the classes out of a mapping file.
This may have advantages over the hibernate solution because mapping an file are consistant but it also has a major drawback:
you cannot just write your classes and - at any point when your programmlogic is at some state - go over and start thinking about persistence. You would have to write a mapping that generates the classes you have written before - nobody will like this work.
I'm afraid as long c++ doesn't provide a reasonable reflection system languages such as Java are - in those special problem domains - better because it is possible to write better libraries and frameworks.
Perhaps a c++ reflection library could solve this problem. There are some (http://seal-reflex.web.cern.ch/seal-reflex/) but this comes to the next c++ drawback: its just more complicated to get a library to run it with the compiler you use(compile and link as debug and release-Versions, as dynamic and static library). But thats another topic ...