ADO.csdl 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <Schema Namespace="Session3_4Model" Alias="Self" annotation:UseStrongSpatialTypes="false" xmlns:annotation="http://schemas.microsoft.com/ado/2009/02/edm/annotation" xmlns:customannotation="http://schemas.microsoft.com/ado/2013/11/edm/customannotation" xmlns="http://schemas.microsoft.com/ado/2009/11/edm">
  3. <EntityType Name="Aircrafts">
  4. <Key>
  5. <PropertyRef Name="ID" />
  6. </Key>
  7. <Property Name="ID" Type="Int32" Nullable="false" />
  8. <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  9. <Property Name="MakeModel" Type="String" MaxLength="10" FixedLength="false" Unicode="true" />
  10. <Property Name="TotalSeats" Type="Int32" Nullable="false" />
  11. <Property Name="EconomySeats" Type="Int32" Nullable="false" />
  12. <Property Name="BusinessSeats" Type="Int32" Nullable="false" />
  13. <NavigationProperty Name="Schedules" Relationship="Self.FK_Schedule_AirCraft" FromRole="Aircrafts" ToRole="Schedules" />
  14. </EntityType>
  15. <EntityType Name="Airports">
  16. <Key>
  17. <PropertyRef Name="ID" />
  18. </Key>
  19. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  20. <Property Name="CountryID" Type="Int32" Nullable="false" />
  21. <Property Name="IATACode" Type="String" MaxLength="3" FixedLength="false" Unicode="false" Nullable="false" />
  22. <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
  23. <NavigationProperty Name="Countries" Relationship="Self.FK_AirPort_Country" FromRole="Airports" ToRole="Countries" />
  24. <NavigationProperty Name="Routes" Relationship="Self.FK_Routes_Airports2" FromRole="Airports" ToRole="Routes" />
  25. <NavigationProperty Name="Routes1" Relationship="Self.FK_Routes_Airports3" FromRole="Airports" ToRole="Routes" />
  26. </EntityType>
  27. <EntityType Name="CabinTypes">
  28. <Key>
  29. <PropertyRef Name="ID" />
  30. </Key>
  31. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  32. <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  33. <NavigationProperty Name="Tickets" Relationship="Self.FK_Ticket_TravelClass" FromRole="CabinTypes" ToRole="Tickets" />
  34. </EntityType>
  35. <EntityType Name="Countries">
  36. <Key>
  37. <PropertyRef Name="ID" />
  38. </Key>
  39. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  40. <Property Name="Name" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  41. <NavigationProperty Name="Airports" Relationship="Self.FK_AirPort_Country" FromRole="Countries" ToRole="Airports" />
  42. <NavigationProperty Name="Offices" Relationship="Self.FK_Office_Country" FromRole="Countries" ToRole="Offices" />
  43. </EntityType>
  44. <EntityType Name="Offices">
  45. <Key>
  46. <PropertyRef Name="ID" />
  47. </Key>
  48. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  49. <Property Name="CountryID" Type="Int32" Nullable="false" />
  50. <Property Name="Title" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  51. <Property Name="Phone" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  52. <Property Name="Contact" Type="String" MaxLength="250" FixedLength="false" Unicode="true" Nullable="false" />
  53. <NavigationProperty Name="Countries" Relationship="Self.FK_Office_Country" FromRole="Offices" ToRole="Countries" />
  54. <NavigationProperty Name="Users" Relationship="Self.FK_Users_Offices" FromRole="Offices" ToRole="Users" />
  55. </EntityType>
  56. <EntityType Name="Roles">
  57. <Key>
  58. <PropertyRef Name="ID" />
  59. </Key>
  60. <Property Name="ID" Type="Int32" Nullable="false" />
  61. <Property Name="Title" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  62. <NavigationProperty Name="Users" Relationship="Self.FK_Users_Roles" FromRole="Roles" ToRole="Users" />
  63. </EntityType>
  64. <EntityType Name="Routes">
  65. <Key>
  66. <PropertyRef Name="ID" />
  67. </Key>
  68. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  69. <Property Name="DepartureAirportID" Type="Int32" Nullable="false" />
  70. <Property Name="ArrivalAirportID" Type="Int32" Nullable="false" />
  71. <Property Name="Distance" Type="Int32" Nullable="false" />
  72. <Property Name="FlightTime" Type="Int32" Nullable="false" />
  73. <NavigationProperty Name="Airports" Relationship="Self.FK_Routes_Airports2" FromRole="Routes" ToRole="Airports" />
  74. <NavigationProperty Name="Airports1" Relationship="Self.FK_Routes_Airports3" FromRole="Routes" ToRole="Airports" />
  75. <NavigationProperty Name="Schedules" Relationship="Self.FK_Schedule_Routes" FromRole="Routes" ToRole="Schedules" />
  76. </EntityType>
  77. <EntityType Name="Schedules">
  78. <Key>
  79. <PropertyRef Name="ID" />
  80. </Key>
  81. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  82. <Property Name="Date" Type="DateTime" Nullable="false" Precision="0" />
  83. <Property Name="Time" Type="Time" Nullable="false" Precision="5" />
  84. <Property Name="AircraftID" Type="Int32" Nullable="false" />
  85. <Property Name="RouteID" Type="Int32" Nullable="false" />
  86. <Property Name="EconomyPrice" Type="Decimal" Precision="19" Scale="4" Nullable="false" />
  87. <Property Name="Confirmed" Type="Boolean" Nullable="false" />
  88. <Property Name="FlightNumber" Type="String" MaxLength="10" FixedLength="false" Unicode="true" />
  89. <NavigationProperty Name="Aircrafts" Relationship="Self.FK_Schedule_AirCraft" FromRole="Schedules" ToRole="Aircrafts" />
  90. <NavigationProperty Name="Routes" Relationship="Self.FK_Schedule_Routes" FromRole="Schedules" ToRole="Routes" />
  91. <NavigationProperty Name="Tickets" Relationship="Self.FK_Ticket_Schedule" FromRole="Schedules" ToRole="Tickets" />
  92. </EntityType>
  93. <EntityType Name="Tickets">
  94. <Key>
  95. <PropertyRef Name="ID" />
  96. </Key>
  97. <Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
  98. <Property Name="UserID" Type="Int32" Nullable="false" />
  99. <Property Name="ScheduleID" Type="Int32" Nullable="false" />
  100. <Property Name="CabinTypeID" Type="Int32" Nullable="false" />
  101. <Property Name="Firstname" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  102. <Property Name="Lastname" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  103. <Property Name="Email" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
  104. <Property Name="Phone" Type="String" MaxLength="14" FixedLength="false" Unicode="true" Nullable="false" />
  105. <Property Name="PassportNumber" Type="String" MaxLength="9" FixedLength="false" Unicode="true" Nullable="false" />
  106. <Property Name="PassportCountryID" Type="Int32" Nullable="false" />
  107. <Property Name="BookingReference" Type="String" MaxLength="6" FixedLength="false" Unicode="true" Nullable="false" />
  108. <Property Name="Confirmed" Type="Boolean" Nullable="false" />
  109. <NavigationProperty Name="CabinTypes" Relationship="Self.FK_Ticket_TravelClass" FromRole="Tickets" ToRole="CabinTypes" />
  110. <NavigationProperty Name="Schedules" Relationship="Self.FK_Ticket_Schedule" FromRole="Tickets" ToRole="Schedules" />
  111. <NavigationProperty Name="Users" Relationship="Self.FK_Ticket_User" FromRole="Tickets" ToRole="Users" />
  112. </EntityType>
  113. <EntityType Name="Users">
  114. <Key>
  115. <PropertyRef Name="ID" />
  116. </Key>
  117. <Property Name="ID" Type="Int32" Nullable="false" />
  118. <Property Name="RoleID" Type="Int32" Nullable="false" />
  119. <Property Name="Email" Type="String" MaxLength="150" FixedLength="false" Unicode="true" Nullable="false" />
  120. <Property Name="Password" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  121. <Property Name="FirstName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
  122. <Property Name="LastName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" Nullable="false" />
  123. <Property Name="OfficeID" Type="Int32" />
  124. <Property Name="Birthdate" Type="DateTime" Precision="0" />
  125. <Property Name="Active" Type="Boolean" />
  126. <NavigationProperty Name="Offices" Relationship="Self.FK_Users_Offices" FromRole="Users" ToRole="Offices" />
  127. <NavigationProperty Name="Roles" Relationship="Self.FK_Users_Roles" FromRole="Users" ToRole="Roles" />
  128. <NavigationProperty Name="Tickets" Relationship="Self.FK_Ticket_User" FromRole="Users" ToRole="Tickets" />
  129. </EntityType>
  130. <Association Name="FK_Schedule_AirCraft">
  131. <End Role="Aircrafts" Type="Self.Aircrafts" Multiplicity="1" />
  132. <End Role="Schedules" Type="Self.Schedules" Multiplicity="*" />
  133. <ReferentialConstraint>
  134. <Principal Role="Aircrafts">
  135. <PropertyRef Name="ID" />
  136. </Principal>
  137. <Dependent Role="Schedules">
  138. <PropertyRef Name="AircraftID" />
  139. </Dependent>
  140. </ReferentialConstraint>
  141. </Association>
  142. <Association Name="FK_AirPort_Country">
  143. <End Role="Countries" Type="Self.Countries" Multiplicity="1" />
  144. <End Role="Airports" Type="Self.Airports" Multiplicity="*" />
  145. <ReferentialConstraint>
  146. <Principal Role="Countries">
  147. <PropertyRef Name="ID" />
  148. </Principal>
  149. <Dependent Role="Airports">
  150. <PropertyRef Name="CountryID" />
  151. </Dependent>
  152. </ReferentialConstraint>
  153. </Association>
  154. <Association Name="FK_Routes_Airports2">
  155. <End Role="Airports" Type="Self.Airports" Multiplicity="1" />
  156. <End Role="Routes" Type="Self.Routes" Multiplicity="*" />
  157. <ReferentialConstraint>
  158. <Principal Role="Airports">
  159. <PropertyRef Name="ID" />
  160. </Principal>
  161. <Dependent Role="Routes">
  162. <PropertyRef Name="DepartureAirportID" />
  163. </Dependent>
  164. </ReferentialConstraint>
  165. </Association>
  166. <Association Name="FK_Routes_Airports3">
  167. <End Role="Airports" Type="Self.Airports" Multiplicity="1" />
  168. <End Role="Routes" Type="Self.Routes" Multiplicity="*" />
  169. <ReferentialConstraint>
  170. <Principal Role="Airports">
  171. <PropertyRef Name="ID" />
  172. </Principal>
  173. <Dependent Role="Routes">
  174. <PropertyRef Name="ArrivalAirportID" />
  175. </Dependent>
  176. </ReferentialConstraint>
  177. </Association>
  178. <Association Name="FK_Ticket_TravelClass">
  179. <End Role="CabinTypes" Type="Self.CabinTypes" Multiplicity="1" />
  180. <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
  181. <ReferentialConstraint>
  182. <Principal Role="CabinTypes">
  183. <PropertyRef Name="ID" />
  184. </Principal>
  185. <Dependent Role="Tickets">
  186. <PropertyRef Name="CabinTypeID" />
  187. </Dependent>
  188. </ReferentialConstraint>
  189. </Association>
  190. <Association Name="FK_Office_Country">
  191. <End Role="Countries" Type="Self.Countries" Multiplicity="1" />
  192. <End Role="Offices" Type="Self.Offices" Multiplicity="*" />
  193. <ReferentialConstraint>
  194. <Principal Role="Countries">
  195. <PropertyRef Name="ID" />
  196. </Principal>
  197. <Dependent Role="Offices">
  198. <PropertyRef Name="CountryID" />
  199. </Dependent>
  200. </ReferentialConstraint>
  201. </Association>
  202. <Association Name="FK_Users_Offices">
  203. <End Role="Offices" Type="Self.Offices" Multiplicity="0..1" />
  204. <End Role="Users" Type="Self.Users" Multiplicity="*" />
  205. <ReferentialConstraint>
  206. <Principal Role="Offices">
  207. <PropertyRef Name="ID" />
  208. </Principal>
  209. <Dependent Role="Users">
  210. <PropertyRef Name="OfficeID" />
  211. </Dependent>
  212. </ReferentialConstraint>
  213. </Association>
  214. <Association Name="FK_Users_Roles">
  215. <End Role="Roles" Type="Self.Roles" Multiplicity="1" />
  216. <End Role="Users" Type="Self.Users" Multiplicity="*" />
  217. <ReferentialConstraint>
  218. <Principal Role="Roles">
  219. <PropertyRef Name="ID" />
  220. </Principal>
  221. <Dependent Role="Users">
  222. <PropertyRef Name="RoleID" />
  223. </Dependent>
  224. </ReferentialConstraint>
  225. </Association>
  226. <Association Name="FK_Schedule_Routes">
  227. <End Role="Routes" Type="Self.Routes" Multiplicity="1" />
  228. <End Role="Schedules" Type="Self.Schedules" Multiplicity="*" />
  229. <ReferentialConstraint>
  230. <Principal Role="Routes">
  231. <PropertyRef Name="ID" />
  232. </Principal>
  233. <Dependent Role="Schedules">
  234. <PropertyRef Name="RouteID" />
  235. </Dependent>
  236. </ReferentialConstraint>
  237. </Association>
  238. <Association Name="FK_Ticket_Schedule">
  239. <End Role="Schedules" Type="Self.Schedules" Multiplicity="1" />
  240. <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
  241. <ReferentialConstraint>
  242. <Principal Role="Schedules">
  243. <PropertyRef Name="ID" />
  244. </Principal>
  245. <Dependent Role="Tickets">
  246. <PropertyRef Name="ScheduleID" />
  247. </Dependent>
  248. </ReferentialConstraint>
  249. </Association>
  250. <Association Name="FK_Ticket_User">
  251. <End Role="Users" Type="Self.Users" Multiplicity="1" />
  252. <End Role="Tickets" Type="Self.Tickets" Multiplicity="*" />
  253. <ReferentialConstraint>
  254. <Principal Role="Users">
  255. <PropertyRef Name="ID" />
  256. </Principal>
  257. <Dependent Role="Tickets">
  258. <PropertyRef Name="UserID" />
  259. </Dependent>
  260. </ReferentialConstraint>
  261. </Association>
  262. <EntityContainer Name="Session3_4Entities" annotation:LazyLoadingEnabled="true">
  263. <EntitySet Name="Aircrafts" EntityType="Self.Aircrafts" />
  264. <EntitySet Name="Airports" EntityType="Self.Airports" />
  265. <EntitySet Name="CabinTypes" EntityType="Self.CabinTypes" />
  266. <EntitySet Name="Countries" EntityType="Self.Countries" />
  267. <EntitySet Name="Offices" EntityType="Self.Offices" />
  268. <EntitySet Name="Roles" EntityType="Self.Roles" />
  269. <EntitySet Name="Routes" EntityType="Self.Routes" />
  270. <EntitySet Name="Schedules" EntityType="Self.Schedules" />
  271. <EntitySet Name="Tickets" EntityType="Self.Tickets" />
  272. <EntitySet Name="Users" EntityType="Self.Users" />
  273. <AssociationSet Name="FK_Schedule_AirCraft" Association="Self.FK_Schedule_AirCraft">
  274. <End Role="Aircrafts" EntitySet="Aircrafts" />
  275. <End Role="Schedules" EntitySet="Schedules" />
  276. </AssociationSet>
  277. <AssociationSet Name="FK_AirPort_Country" Association="Self.FK_AirPort_Country">
  278. <End Role="Countries" EntitySet="Countries" />
  279. <End Role="Airports" EntitySet="Airports" />
  280. </AssociationSet>
  281. <AssociationSet Name="FK_Routes_Airports2" Association="Self.FK_Routes_Airports2">
  282. <End Role="Airports" EntitySet="Airports" />
  283. <End Role="Routes" EntitySet="Routes" />
  284. </AssociationSet>
  285. <AssociationSet Name="FK_Routes_Airports3" Association="Self.FK_Routes_Airports3">
  286. <End Role="Airports" EntitySet="Airports" />
  287. <End Role="Routes" EntitySet="Routes" />
  288. </AssociationSet>
  289. <AssociationSet Name="FK_Ticket_TravelClass" Association="Self.FK_Ticket_TravelClass">
  290. <End Role="CabinTypes" EntitySet="CabinTypes" />
  291. <End Role="Tickets" EntitySet="Tickets" />
  292. </AssociationSet>
  293. <AssociationSet Name="FK_Office_Country" Association="Self.FK_Office_Country">
  294. <End Role="Countries" EntitySet="Countries" />
  295. <End Role="Offices" EntitySet="Offices" />
  296. </AssociationSet>
  297. <AssociationSet Name="FK_Users_Offices" Association="Self.FK_Users_Offices">
  298. <End Role="Offices" EntitySet="Offices" />
  299. <End Role="Users" EntitySet="Users" />
  300. </AssociationSet>
  301. <AssociationSet Name="FK_Users_Roles" Association="Self.FK_Users_Roles">
  302. <End Role="Roles" EntitySet="Roles" />
  303. <End Role="Users" EntitySet="Users" />
  304. </AssociationSet>
  305. <AssociationSet Name="FK_Schedule_Routes" Association="Self.FK_Schedule_Routes">
  306. <End Role="Routes" EntitySet="Routes" />
  307. <End Role="Schedules" EntitySet="Schedules" />
  308. </AssociationSet>
  309. <AssociationSet Name="FK_Ticket_Schedule" Association="Self.FK_Ticket_Schedule">
  310. <End Role="Schedules" EntitySet="Schedules" />
  311. <End Role="Tickets" EntitySet="Tickets" />
  312. </AssociationSet>
  313. <AssociationSet Name="FK_Ticket_User" Association="Self.FK_Ticket_User">
  314. <End Role="Users" EntitySet="Users" />
  315. <End Role="Tickets" EntitySet="Tickets" />
  316. </AssociationSet>
  317. </EntityContainer>
  318. </Schema>