Way to map table name and class name

Forum for posting problems using QxOrm library

Way to map table name and class name

Postby behtgod » Mon Nov 16, 2015 8:30 am

Is there a way to map table name and class name?
For example,
I have a class is named ClassA,and I have a table is named TableA.
I want ClassA is mapping with TableA instead of create a new class that name TableA.
behtgod
 
Posts: 18
Joined: Mon Nov 16, 2015 8:21 am

Re: Way to map table name and class name

Postby qxorm » Mon Nov 16, 2015 8:59 am

Hello and welcome to this forum :)

Is there a way to map table name and class name?

Yes there is a way, in your qx::register_class<T>() method, just use :
Code: Select all
t.setName("TableA");


For this kind of questions, I would recommend to test QxEntityEditor application : this application includes an entity designer, and you are able to modify entity parameters and then see how C++ should be with the C++ preview tab.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Way to map table name and class name

Postby behtgod » Mon Nov 16, 2015 10:03 am

qxorm wrote:Hello and welcome to this forum :)

Is there a way to map table name and class name?

Yes there is a way, in your qx::register_class<T>() method, just use :
Code: Select all
t.setName("TableA");


For this kind of questions, I would recommend to test QxEntityEditor application : this application includes an entity designer, and you are able to modify entity parameters and then see how C++ should be with the C++ preview tab.


Thank you very much!
behtgod
 
Posts: 18
Joined: Mon Nov 16, 2015 8:21 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 13 guests

cron