Skip to Content
0

Hana xsa xsodata / hdbcds associations

Aug 15, 2017 at 12:06 PM

111

avatar image
Former Member

Hi All,
Can some one help me with the following case?

in my resumes.hdbcds i've got 2 entities (I left out unnecessary fields):

entity Resume {
key resumeId         : Integer;
    employeeId       : Integer;
    language         : String(2); // nl: Dutch, en: English
    info            : String(100);        
};


entity Employee {
    key employeeId      : Integer generated by default as identity(start with 1 increment by 1);
        name       : String(50);
        resumeNL       : association[1] to Resume 
                                on resumeNL.employeeId = employeeId 
                                and resumeNL.language = 'nl';
};

Now I have a resumes.xsodata file where I want to create the following association:

"resumes.Employee" as "Employee" navigates ("Employee_ResumeNL" as "ResumeNL");
association "Employee_ResumeNL" 
principal "Employee"("resumeNL.resumeId") multiplicity "1" 
dependent "Resume"("resumeId") multiplicity "1";

"resumes.Resume" as "Resume" ;

but when I visit the odata service /Employee(1)/ResumeNL, I get the following error:

{error: 
{code: 500,
message: 
{lang: "en-US",
value: "invalid column name: Employee1.resumeNL.resumeId: line 5 col 55 (at pos 327)"
}
}
}

anyone?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
avatar image
Former Member Aug 16, 2017 at 10:21 AM
0

Found the solution

I need to create a view

view ResumeNL as select from Resume { resumeId, employeeId } where "language" = 'nl';

and then in the xsodata file I can do this

"resumes.Employee" as "Employee" navigates ("Employee_ResumeNL" as "ResumeNL");
association "Employee_ResumeNL" 
principal "Employee"("employeeId") multiplicity "1" 
dependent "Resume"("resumeId") multiplicity "1"
over "resumes.ResumeNL" principal("employeeId") dependent("resumeId");

"resumes.Resume" as "Resume" ;
Share
10 |10000 characters needed characters left characters exceeded