cancel
Showing results for 
Search instead for 
Did you mean: 

Hana xsa xsodata / hdbcds associations

Former Member
0 Kudos

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?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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" ;

Answers (0)