Page 1 of 1

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

PostPosted: Tue Jul 05, 2016 10:28 am
by behtgod
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?

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

PostPosted: Tue Jul 05, 2016 3:51 pm
by qxorm
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.

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

PostPosted: Wed Jul 06, 2016 7:12 am
by behtgod
I got it. Thank you very much!