简体   繁体   中英

Can ORM ODB for C++ generate code from a database

I am fairly new to this library, and ORM in general. I know tools like EntityFramework can generate code from a database. Can ODB for C++ do this work?

I don't think so. Looking at the main page of the project, there is an example how to use ODB. It seem that you need only add some pragmas here and there:

#pragma db object
class person
{
  ...
private:
  friend class odb::access;
  person () {}

  #pragma db id
  string email_;

  string name_;
  unsigned short age_;
};

but you do that on already present code, so no, it does not generate anything.

the QxORM maybe help you to this work. this library use for Qt framework.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM