Could define the colume name in many-to-one relationship?

Forum for posting problems using QxOrm library

Could define the colume name in many-to-one relationship?

Postby behtgod » Tue Jul 05, 2016 10:28 am

For example there are two table:
|t1 |
|------ |
|id |
|t2_id |

|t2 |
|------ |
|id |

I want define a many-to-one relationship between t1.t2_id and t2.id.
But ,the qx::QxClass<T>::relationManyToOne() only one parameter to define colume name.
Can't I define both two colume?
behtgod
 
Posts: 18
Joined: Mon Nov 16, 2015 8:21 am

Re: Could define the colume name in many-to-one relationship

Postby qxorm » Tue Jul 05, 2016 3:51 pm

Hello,

the qx::QxClass<T>::relationManyToOne() only one parameter to define colume name

This is normal : you just have to define the column name on the 'Many' side.
On the 'One' side, QxOrm library knows that this is the primary key, so you can put here the column name you want.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: Could define the colume name in many-to-one relationship

Postby behtgod » Wed Jul 06, 2016 7:12 am

I got it. 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 4 guests

cron