Page 1 of 1

How to define table name

PostPosted: Tue Jul 17, 2012 9:51 am
by nickla
As i understand QxOrm gets table name from business model name. I use camel case formating in my project and want to use different model name from database table name. How can i set table name from business model?

Re: How to define table name

PostPosted: Tue Jul 17, 2012 9:53 am
by nickla

Re: How to define table name

PostPosted: Tue Jul 17, 2012 12:11 pm
by QxOrm admin
Hi,

Can i use http://www.qxorm.com/doxygen/html/class ... 97b18400f6 this for it (setName function)?

Yes !

Here is another topic with the same question : http://www.qxorm.com/forum/phpbb/viewto ... 8a8c3980a2
And here is the solution :
Code: Select all
namespace qx {
template <> void register_class(QxClass<my_class> & t)
{
   t.setName("TABLE_NAME");
   //...
}}

Re: How to define table name

PostPosted: Tue Jul 17, 2012 1:42 pm
by nickla
Thank you.