ManyToMany extra table: additional fields

Forum for posting problems using QxOrm library

ManyToMany extra table: additional fields

Postby gianks » Tue Aug 23, 2016 3:25 pm

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
gianks
 
Posts: 45
Joined: Mon Jul 04, 2016 1:04 pm

Re: ManyToMany extra table: additional fields

Postby qxorm » Wed Aug 24, 2016 7:35 am

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.
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am

Re: ManyToMany extra table: additional fields

Postby gianks » Wed Aug 24, 2016 2:18 pm

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
gianks
 
Posts: 45
Joined: Mon Jul 04, 2016 1:04 pm

Re: ManyToMany extra table: additional fields

Postby qxorm » Wed Aug 24, 2016 3:04 pm

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 !
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron