Skip to content

Instantly share code, notes, and snippets.

@julianschmuckli
Last active August 29, 2019 10:16
Show Gist options
  • Save julianschmuckli/70fdfa2ca5d5438631d381504a35ae44 to your computer and use it in GitHub Desktop.
Save julianschmuckli/70fdfa2ca5d5438631d381504a35ae44 to your computer and use it in GitHub Desktop.
This is the example CSDL of the CanteenService for the openSAP course "Build Mobile Applications with SAP Cloud Platform Mobile Services" Week 2 Unit 1.
<?xml version="1.0" encoding="utf-8"?>
<edmx:Edmx Version="4.0" xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://docs.oasis-open.org/odata/ns/edmx http://docs.oasis-open.org/odata/odata/v4.0/os/schemas/edmx.xsd http://docs.oasis-open.org/odata/ns/edm http://docs.oasis-open.org/odata/odata/v4.0/os/schemas/edm.xsd">
<edmx:Reference Uri="vocabularies/com.sap.cloud.server.odata.sql.v1.xml">
<edmx:Include Namespace="com.sap.cloud.server.odata.sql.v1" Alias="SQL"/>
</edmx:Reference>
<edmx:DataServices>
<Schema Namespace="com.sap.canteen" xmlns="http://docs.oasis-open.org/odata/ns/edm">
<EntityType Name="Booking">
<Key>
<PropertyRef Name="BookingID"/>
</Key>
<Property Name="BookingDate" Type="Edm.DateTimeOffset" Nullable="false"/>
<Property Name="BookingID" Type="Edm.Int64" Nullable="false"/>
<Property Name="DishMenuID" Type="Edm.Int64" Nullable="false"/>
<Property Name="MenuID" Type="Edm.Int64" Nullable="false"/>
<Property Name="Price" Type="Edm.Decimal" Nullable="false" Precision="10" Scale="2"/>
<Property Name="Status" Type="Edm.String" Nullable="false" MaxLength="20"/>
<Property Name="User" Type="Edm.String" Nullable="false" MaxLength="100"/>
<NavigationProperty Name="Bookings" Type="com.sap.canteen.DishMenu" Nullable="false" Partner="MenuBooked">
<ReferentialConstraint Property="DishMenuID" ReferencedProperty="DishMenuID"/>
</NavigationProperty>
</EntityType>
<EntityType Name="Canteen">
<Key>
<PropertyRef Name="CanteenID"/>
</Key>
<Property Name="CanteenID" Type="Edm.Int64" Nullable="false"/>
<Property Name="Location" Type="Edm.String" Nullable="false" MaxLength="100"/>
<Property Name="MenuID" Type="Edm.Int64" Nullable="false"/>
<Property Name="Name" Type="Edm.String" Nullable="false" MaxLength="100"/>
<NavigationProperty Name="serveMenues" Type="Collection(com.sap.canteen.DishMenu)" Partner="inCanteen"/>
</EntityType>
<EntityType Name="DishMenu">
<Key>
<PropertyRef Name="DishMenuID"/>
</Key>
<Property Name="BookingID" Type="Edm.Int64" Nullable="false"/>
<Property Name="CanteenID" Type="Edm.Int64" Nullable="false"/>
<Property Name="Dessert" Type="Edm.String" Nullable="true"/>
<Property Name="DishMenuID" Type="Edm.Int64" Nullable="false"/>
<Property Name="MainDish" Type="Edm.String" Nullable="false"/>
<Property Name="Price" Type="Edm.Decimal" Nullable="false" Precision="10" Scale="2"/>
<Property Name="Sides" Type="Edm.String" Nullable="false" MaxLength="100"/>
<Property Name="Soup" Type="Edm.String" Nullable="true" MaxLength="100"/>
<Property Name="dateOfLunch" Type="Edm.DateTimeOffset" Nullable="false"/>
<Property Name="kcalForMain" Type="Edm.Int32" Nullable="false"/>
<Property Name="veggie" Type="Edm.Boolean" Nullable="true"/>
<NavigationProperty Name="MenuBooked" Type="Collection(com.sap.canteen.Booking)" Partner="Bookings"/>
<NavigationProperty Name="inCanteen" Type="com.sap.canteen.Canteen" Nullable="false" Partner="serveMenues">
<ReferentialConstraint Property="CanteenID" ReferencedProperty="CanteenID"/>
</NavigationProperty>
</EntityType>
<EntityContainer Name="CanteenService">
<Annotation Term="SQL.TrackChanges"/>
<EntitySet Name="BookingSet" EntityType="com.sap.canteen.Booking">
<NavigationPropertyBinding Path="Bookings" Target="DishMenuSet"/>
</EntitySet>
<EntitySet Name="CanteenSet" EntityType="com.sap.canteen.Canteen">
<NavigationPropertyBinding Path="serveMenues" Target="DishMenuSet"/>
</EntitySet>
<EntitySet Name="DishMenuSet" EntityType="com.sap.canteen.DishMenu">
<NavigationPropertyBinding Path="MenuBooked" Target="BookingSet"/>
<NavigationPropertyBinding Path="inCanteen" Target="CanteenSet"/>
</EntitySet>
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment