Airline (Example)
This CSN example document shows how the airline example is expressed with a CDS Service exposing the entities through an API.
Entity Definitions
AirlineService.Airline
Entity exposed via: AirlineService
Human readable description of the entity AirlineService.Airline, in markdown.
abstract: false
@EntityRelationship.entityType: "sap.vdm.sont:AirlineService.Airline"
@EndUserText.label: "Airline"
@ObjectModel.modelingPattern: {"#":"ANALYTICAL_DIMENSION"}
Elements:
| Element | Type | Description |
|---|---|---|
| AirlineID | AirlineUuid | Add human readable documentation text in markdown here, database storage ID. key: truedefault: {"val":3}@EndUserText.label: "Airline"@ObjectModel.text.element: ["Name"] |
| Name | cds.String(40) | The name of the airline. @EndUserText.label: "Name"@Semantics.text: true |
| CurrencyCode_code | cds.String(33) | Lorem ipsum dolor sit amet, consetetur sadipscing elitr, @EndUserText.label: "Currency Code"@Semantics.currencyCode: true |
AirlineService.Airport
Entity exposed via: AirlineService
@EndUserText.label: "Airport"
@ObjectModel.modelingPattern: {"#":"ANALYTICAL_DIMENSION"}
Elements:
| Element | Type | Description |
|---|---|---|
| AirportID | cds.String(3) | key: true@EndUserText.label: "Airport"@ObjectModel.text.element: ["Name"] |
| Name | cds.String(40) | @EndUserText.label: "Name"@Semantics.text: true |
| City | cds.String(40) | @EndUserText.label: "City" |
| CountryCode_code | cds.String(3) | @EndUserText.label: "Country Code"@ObjectModel.foreignKey.association: {"=":"to_CountryCode"} |
| CountryNumber_number | cds.Integer | @EndUserText.label: "Country Number"@ObjectModel.foreignKey.association: {"=":"to_CountryNumber"} |
| to_CountryCode | cds.Association | Association to one AirlineService.Countries (path: AirlineService.Countries.code) via CountryCode_code |
| to_CountryNumber | cds.Association | Association to one AirlineService.Countries (path: AirlineService.Countries.number) via CountryNumber_number |
AirlineService.Countries
Entity exposed via: AirlineService
@EndUserText.label: "Countries"
@ObjectModel.modelingPattern: {"#":"ANALYTICAL_DIMENSION"}
Elements:
| Element | Type | Description |
|---|---|---|
| code | cds.String(3) | key: true@EndUserText.label: "Country Code"@ObjectModel.text.association: {"=":"texts"} |
| number | cds.Integer | key: true@EndUserText.label: "Country Number" |
| texts | cds.Composition |
AirlineService.Countries_texts
Entity exposed via: AirlineService
@EndUserText.label: "Countries Texts"
@ObjectModel.modelingPattern: {"#":"LANGUAGE_DEPENDENT_TEXT"}
Elements:
| Element | Type | Description |
|---|---|---|
| code | cds.String(3) | key: true@EndUserText.label: "Country Code" |
| locale | cds.String(14) | key: true@EndUserText.label: "Language Code"@Semantics.language: true |
| name | cds.String(255) | @EndUserText.label: "Name"@Semantics.text: true |
| descr | cds.String(1000) | @EndUserText.label: "Description"@Semantics.text: true |
AirlineService.FlightConnection
Entity exposed via: AirlineService
@EndUserText.label: "Flight Connection"
@ObjectModel.representativeKey: {"=":"ConnectionID"}
@ObjectModel.modelingPattern: {"#":"ANALYTICAL_DIMENSION"}
Elements:
| Element | Type | Description |
|---|---|---|
| AirlineID | cds.String(3) | key: true@EndUserText.label: "Airline"@ObjectModel.foreignKey.association: {"=":"to_Airline"} |
| ConnectionID | cds.String(4) | key: true@EndUserText.label: "Flight Number" |
| DepartureAirport_AirportID | cds.String(3) | @EndUserText.label: "Departure Airport"@ObjectModel.foreignKey.association: {"=":"to_DepartureAirport"} |
| DestinationAirport_AirportID | cds.String(3) | @EndUserText.label: "Destination Airport"@ObjectModel.foreignKey.association: {"=":"to_DestinationAirport"} |
| DepartureTime | cds.Time | @EndUserText.label: "Departure Time" |
| ArrivalTime | cds.Time | @EndUserText.label: "Arrival Time" |
| Distance | cds.Integer | @EndUserText.label: "Distance"@Semantics.quantity.unitOfMeasure: {"=":"DistanceUnit"} |
| DistanceUnit | cds.String(3) | @EndUserText.label: "Distance Unit" |
| to_Airline | cds.Association | Association to many AirlineService.Airline (path: AirlineService.Airline.AirlineID) via AirlineID |
| to_DepartureAirport | cds.Association | Association to many AirlineService.Airport (path: AirlineService.Airport.AirportID) via DepartureAirport_AirportID |
| to_DestinationAirport | cds.Association | Association to many AirlineService.Airport (path: AirlineService.Airport.AirportID) via DestinationAirport_AirportID |
AirlineService.Flight
Entity exposed via: AirlineService
@EndUserText.label: "Flight"
@ObjectModel.modelingPattern: {"#":"ANALYTICAL_FACT"}
@ObjectModel.supportedCapabilities: [{"#":"DATA_STRUCTURE"}]
Elements:
| Element | Type | Description |
|---|---|---|
| AirlineID | cds.String(3) | key: true@EndUserText.label: "Airline"@ObjectModel.foreignKey.association: {"=":"to_Airline"} |
| FlightDate | cds.Date | key: true@EndUserText.label: "Flight Date" |
| ConnectionID | cds.String(4) | key: true@EndUserText.label: "Flight Number"@ObjectModel.foreignKey.association: {"=":"to_Connection"} |
| Price | cds.Decimal | precision: 16scale: 3@EndUserText.label: "Price"@Aggregation.default: {"#":"MIN"}@Semantics.amount.currencyCode: {"=":"CurrencyCode_code"} |
| CurrencyCode_code | cds.String(3) | @EndUserText.label: "Currency Code"@Semantics.currencyCode: true |
| PlaneType | cds.String(10) | @EndUserText.label: "Plane Type" |
| MaximumSeats | cds.Integer | @EndUserText.label: "Maximum Seats"@Aggregation.default: {"#":"SUM"} |
| OccupiedSeats | cds.Integer | @EndUserText.label: "Occupied Seats"@Aggregation.default: {"#":"SUM"} |
| to_Airline | cds.Association | Association to many AirlineService.Airline (path: AirlineService.Airline.AirlineID) via AirlineID |
| to_Connection | cds.Association | Association to many AirlineService.FlightConnection (path: AirlineService.FlightConnection.AirlineID) via AirlineID |
UnassignedEntity
This entity is not prefixed with the service name and therefore not accessible through the service.
Elements:
| Element | Type | Description |
|---|---|---|
| SomeElement | cds.String | key: true |
Type Definitions
AirlineUuid
Description of the reuse type
| Type | Description |
|---|---|
| cds.String(3) | @EndUserText.label: "Airline"@ObjectModel.text.element: ["Name"] |
Services
AirlineService
This is describing the service that exposes the CDS entities through an API.
Exposed Entities: