cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a assiciation in SAP HANA CDS ?

former_member529961
Participant
0 Kudos

Hello experts. I want to build a Assication between two Entitys in my hdbcds file.

i try somthing like this:

Entity User {

key Email : String(255);

settingId : Integer

setting: Association [1] to Setting on setting.settingId = settingId

}

Entity Setting{

key settingId : Integer;

Email: string(255)

...

}

I simply want that 1 user has 1 Setting. When i try it . like this in show in the metadata i see there is no navigation property. Im confused, how to create an 1 to 1 assication ?

pfefferf
Active Contributor

Do you get an error (I don't think so)? How does your (XS)odata service definition look like, did you define the association the odata service too?

former_member529961
Participant
0 Kudos

yes i get no error.

my service look like this:

service{

"NewsletterData.User" as "Users";

"NewsletterData.Settings" as "Settings";

}

so in my service i did nothing changed, need this file a change ?

Accepted Solutions (1)

Accepted Solutions (1)

pfefferf
Active Contributor

As discussed in comments, your odata definition has not modelled the association. You have to do that there too.

Answers (0)