Skip to Content
0
Apr 11, 2018 at 06:39 PM

How to Create Many-to-Many Relationship Association in xsodata

638 Views

Hi experts,

I have a Technology table and a Project table. The relationship between two of them are many-to-many. A project can used multiple technologies and a technology can be used in different projects. Thus I also have a relationship table Project_Technology. Its primary keys are PId and TId. I created a xsodata file to expose the data. However I'm getting syntax error on the association. Any thoughts would be helpful.

service {
    "PROJECT_EXPLORER"."Technology" as "Technologies";
    "PROJECT_EXPLORER"."Project" as "Projects" navigates ("Projects_Technologies" as "Has");
    association "Projects_Technologies" with referential constraint principal "Projects"("Id") multiplicity "*" dependent "Technologies"("Id") multiplicity "*" 
        over "PROJECT_EXPLORER"."Project_Technology" principal ("PId") dependent ("TId");
}