I don't recommend to use "
qx::create_table<>" in a real project.
I think it is a lot better to design your database with a tool provided by your SGDB.
However, if you really want to use "
qx::create_table<>" to create your database by program, you can try this (but I have not tested yet) :
In your "
qx::register_class<T>", when you map your class properties, try something like this :
- Code: Select all
qx::IxDataMember * pData = NULL;
pData = t.data(& MyClass::m_property, "XXX");
pData->setAutoIncrement(true);
When you use "
t.data(...)", an object of type "
qx::IxDataMember *" is returned.
Then, you have some methods that you can apply to each property registered into QxOrm context.
When you write "
pData->setAutoIncrement(true);", normally, this will add "
AUTOINCREMENT" keyword with "
qx::create_table<>".