Page 1 of 1
ManyToMany extra table: additional fields
Posted:
Tue Aug 23, 2016 3:25 pm
by gianks
HI,
i need to add some extra columns on a many-to-many extra table.
I've seen nothing about this in the documentation but doesn't mean i didn't miss it: have i to register somehow this entity depending on the relationship?
Thanks
Re: ManyToMany extra table: additional fields
Posted:
Wed Aug 24, 2016 7:35 am
by qxorm
Hello,
I think you should split your n-n relationship into two 1-n relationships.
Imagine you have these tables, A, extra_table and B :
- A : 1-n to extra_table ;
- B : 1-n to extra_table.
Then, extra_table becomes a persistent class in C++ registered in QxOrm context.
And you can add all columns you want.
Re: ManyToMany extra table: additional fields
Posted:
Wed Aug 24, 2016 2:18 pm
by gianks
Hi,
indeed i've been able to successful combine 1-N and N-N relationships with a composite primary key type to obtain exactly what i needed!
Thanks a lot
Re: ManyToMany extra table: additional fields
Posted:
Wed Aug 24, 2016 3:04 pm
by qxorm
i've been able to successful combine 1-N and N-N relationships with a composite primary key type to obtain exactly what i needed!
Great !