This is a migrated thread and some comments may be shown as answers.

how to make relation between a many to many join table and one persistent class?

1 Answer 57 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
amir sherafatian
Top achievements
Rank 1
amir sherafatian asked on 14 Sep 2009, 12:18 PM
hi
i have two persistent class with name : persons and jobs and the resault of their many-to-many relations is a join table with name PersonJob in my database
and now i want to make a many-to-many relation between PersonJob and another one persistent class with name Roles
for this i think , i must have that join table (PersonJob) as a object class in my application to declare a collection of Roles class in it
and declare a collection of join table (PersonJob) to Roles Class
how can i do this ?
how to make relation between a many to many join table and one persistent class?

1 Answer, 1 is accepted

Sort by
0
IT-Als
Top achievements
Rank 1
answered on 14 Sep 2009, 02:10 PM
Hi Amir,

I think you're on the right way...

In my opinion you need a JobPerson class (not a table since you already have this generated by OA - namely the join_table)
On this class, you'll have a reference to the Job, Person and the Roles classes. So in fact you're putting in an intermidiator class to hold the "extra" reference on the join table.
I think I remember an exact example of doing this in either the knowledge base or in the docs..check them

regards

Henrik
Tags
Design Time (Visual Designer & Tools)
Asked by
amir sherafatian
Top achievements
Rank 1
Answers by
IT-Als
Top achievements
Rank 1
Share this question
or