cancel
Showing results for 
Search instead for 
Did you mean: 

XSODATA many to many association with combined primary key

Former Member
0 Kudos

Hi everybody,

i have two tables and a view:

- the view Offers with the primary key "FLEXID"

- the table ChargingOrders with the primary key "LAID"

- the table FlexibilityOffers with the combined primary key "FLEXID" and "LAID"

One Order can be associated to many Offers and an Offer consists of many Orders, but i am not able to get this working in my .xsodata file. The corresponding lines are the following:


service namespace "FlexiForecast.services" {

    "A627603"."FLEXIBILITAETSANGEBOTE" as "FlexibilityOffers";

    "A627603"."LADEAUFTRAEGE" as "ChargingOrders";

    "e4u.usr.a627603.FlexiForecast.services.flexibility::Offers" as "Offers" key ("FLEXID") navigates ("OfferChargingOrderAllocation" as "offerOrderAl");

   

    association "OfferChargingOrderAllocation" principal "Offers"("FLEXID") multiplicity "*" dependent "ChargingOrders"("LAID") multiplicity "*" over "FlexibilityOffers" principal ("FLEXID") dependent ("LAID");

}

But i am always getting "Invalid association table name "FlexibilityOffers". If i try to set the table directly, i am getting a syntax error.

Best regards,

Tobias

Accepted Solutions (0)

Answers (1)

Answers (1)

pfefferf
Active Contributor
0 Kudos

Hello Tobias,

to my knowledge the "over" keyword cannot handle alias names defined in the service, catalog object names (like yours in format "schema"."table") and synonyms.

The only working way (at least for me) is to use a repository artifact (e.g. a table defined via .hdbtable or hdbdd/hdbcds).

Regards,

Florian