Skip to content
Snippets Groups Projects
Commit 065cdfb7 authored by Goik Martin's avatar Goik Martin
Browse files

Movind Sda1 to archived status

parent f9e9d819
No related branches found
No related tags found
No related merge requests found
...@@ -75,10 +75,158 @@ ...@@ -75,10 +75,158 @@
<section xml:id="persistSectGettingStarted"> <section xml:id="persistSectGettingStarted">
<title>Getting started</title> <title>Getting started</title>
<para>The subsequent exercises focus on the <quote <qandaset defaultlabel="qanda" xml:id="airlineRelationalSchema">
linkend="airlineRelationalSchema">Airline</quote> domain model. We provide <title>Airlines, airports and flights</title>
a step by step development of a <xref linkend="glo_Java"/> domain model
based on using <xref linkend="glo_JPA"/> annotations.</para> <qandadiv>
<qandaentry>
<question>
<para>Implement a relational schema describing airlines, flights,
airports and their respective relationships:</para>
<itemizedlist>
<listitem>
<para>Airline:</para>
<itemizedlist>
<listitem>
<para>An informal unique name like e.g.
<quote>Lufthansa</quote>.</para>
</listitem>
<listitem>
<para>A unique <link
xlink:href="https://en.wikipedia.org/wiki/List_of_airline_codes">ICAO
abbreviation</link>.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>Destination</para>
<itemizedlist>
<listitem>
<para>Full name like <quote>Frankfurt am Main
International</quote></para>
</listitem>
<listitem>
<para>World airport code like <quote>FRA</quote>.</para>
</listitem>
</itemizedlist>
</listitem>
<listitem>
<para>Flight</para>
<itemizedlist>
<listitem>
<para>A unique flight number e.g. LH 4234</para>
</listitem>
<listitem>
<para>The <quote>owning</quote> airline.</para>
</listitem>
<listitem>
<para>originating airport</para>
</listitem>
<listitem>
<para>destination airport</para>
</listitem>
<listitem>
<para>Constraint: origin and destination must
differ.</para>
</listitem>
</itemizedlist>
</listitem>
</itemizedlist>
<para>Provide surrogate keys for all entities and provide names
for all constraints (<abbrev>e.g.</abbrev> defining
<code>CONSTRAINT _PK_XYZ PRIMARY KEY(...)</code> etc. ).</para>
</question>
<answer>
<para>Extended version providing user defined constraint names
using fully qualified foreign key reference column names:</para>
<programlisting language="sql">DROP TABLE IF EXISTS Flight;
DROP TABLE IF EXISTS Destination;
DROP TABLE IF EXISTS Airline;
CREATE Table Airline (
id INT NOT NULL
,name CHAR(20) NOT NULL
,airlineCode CHAR(5) NOT NULL
,CONSTRAINT _PK_Airline_id PRIMARY KEY(id)
,CONSTRAINT _UN_Airline_name UNIQUE(name)
,CONSTRAINT _UN_Airline_airlineCode UNIQUE(airlineCode)
);
CREATE TABLE Destination (
id INT NOT NULL
,fullName CHAR(20) NOT NULL
,airportCode CHAR(5)
,CONSTRAINT _PK_Destination_id PRIMARY KEY(id)
,CONSTRAINT _UN_Destination_airportCode UNIQUE(airportCode)
);
CREATE TABLE Flight (
id INT NOT NULL
,flightNumber CHAR(10) NOT NULL
,airline INT NOT NULL
,origin int NOT NULL
,destination int NOT NULL
,CONSTRAINT _PK_Flight_id UNIQUE(id)
,CONSTRAINT _UN_Flight_flightNumber UNIQUE(flightNumber)
,CONSTRAINT _PK_Flight_ref_airline FOREIGN KEY (origin) REFERENCES Airline(id)
,CONSTRAINT _PK_Flight_ref_origin FOREIGN KEY (origin) REFERENCES Destination(id)
,CONSTRAINT _PK_Flight_ref_destination FOREIGN KEY (destination) REFERENCES Destination(id)
,CONSTRAINT _CK_Flight_origin_destination CHECK(NOT(origin = destination))
);</programlisting>
<para>Compact version using auto generated constraint
names:</para>
<programlisting language="sql">DROP TABLE IF EXISTS Flight;
DROP TABLE IF EXISTS Destination;
DROP TABLE IF EXISTS Airline;
CREATE Table Airline (
id INT NOT NULL PRIMARY KEY
,name CHAR(20) NOT NULL UNIQUE
,airlineCode CHAR(5) NOT NULL UNIQUE
);
CREATE TABLE Destination (
id INT NOT NULL PRIMARY KEY
,fullName CHAR(20) NOT NULL
,airportCode CHAR(5) UNIQUE
);
CREATE TABLE Flight (
id INT NOT NULL UNIQUE
,flightNumber CHAR(10) NOT NULL UNIQUE
,airline INT NOT NULL REFERENCES Airline
,origin int NOT NULL REFERENCES Destination
,destination int NOT NULL REFERENCES Destination
,CONSTRAINT _CK_Flight_origin_destination CHECK(NOT(origin = destination))
);</programlisting>
</answer>
</qandaentry>
</qandadiv>
</qandaset>
<section xml:id="persistSectAirlineProject"> <section xml:id="persistSectAirlineProject">
<title>Creating a Hibernate <xref linkend="glo_JPA"/> project</title> <title>Creating a Hibernate <xref linkend="glo_JPA"/> project</title>
...@@ -87,6 +235,12 @@ ...@@ -87,6 +235,12 @@
<qandadiv> <qandadiv>
<qandaentry> <qandaentry>
<question> <question>
<para>This exercises focus on the <quote
linkend="airlineRelationalSchema">Airline</quote> domain model.
We provide a step by step development of a <xref
linkend="glo_Java"/> domain model based on using <xref
linkend="glo_JPA"/> annotations.</para>
<para>We create a Maven based project. In the current exercise <para>We create a Maven based project. In the current exercise
we only map Airline instances completely ignoring all remaining we only map Airline instances completely ignoring all remaining
model components.</para> model components.</para>
......
...@@ -125,51 +125,6 @@ ...@@ -125,51 +125,6 @@
<xi:include href="Sd1/appendix.xml" xpointer="element(/1)"/> <xi:include href="Sd1/appendix.xml" xpointer="element(/1)"/>
</part> </part>
<part annotations="forumId=10;" xml:id="sda1">
<title>Structured Data and Applications 1</title>
<xi:include href="Sda1/prerequisites.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/xmlintro.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/xmlschema.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/dom.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/jdbc.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/jpaintro.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/mongodb.xml" xpointer="element(/1)"/>
<appendix xml:id="sda1_appendix">
<title>Appendix</title>
<xi:include href="Sda1/projects.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/vaadin.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/xslt.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/sax.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/fo.xml" xpointer="element(/1)"/>
<section xml:id="sda1_exams">
<title>Past SDA1 examinations</title>
<xi:include href="Sda1/Exam/2019/Summer/exam.xml"
xpointer="element(/1)"/>
<xi:include href="Sda1/Exam/2019/Winter/Solve/Doc/tasks.xml"
xpointer="element(/1)"/>
<xi:include href="Sda1/Exam/2020/Summer/Solve/Doc/tasks.xml"
xpointer="element(/1)"/>
</section>
</appendix>
</part>
<part xml:id="tdoc"> <part xml:id="tdoc">
<title>Technical Documentation</title> <title>Technical Documentation</title>
......
<?xml version="1.0" encoding="UTF-8"?>
<part annotations="forumId=10;" xml:id="sda1"
xmlns="http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xila="http://www.w3.org/2001/XInclude/local-attributes"
xmlns:xi="http://www.w3.org/2001/XInclude"
xmlns:trans="http://docbook.org/ns/transclusion"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:db="http://docbook.org/ns/docbook">
<title>Structured Data and Applications 1</title>
<xi:include href="Sda1/prerequisites.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/xmlintro.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/xmlschema.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/dom.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/jdbc.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/jpaintro.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/mongodb.xml" xpointer="element(/1)"/>
<appendix xml:id="sda1_appendix">
<title>Appendix</title>
<xi:include href="Sda1/projects.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/vaadin.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/xslt.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/sax.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/fo.xml" xpointer="element(/1)"/>
<section xml:id="sda1_exams">
<title>Past SDA1 examinations</title>
<xi:include href="Sda1/Exam/2019/Summer/exam.xml" xpointer="element(/1)"/>
<xi:include href="Sda1/Exam/2019/Winter/Solve/Doc/tasks.xml"
xpointer="element(/1)"/>
<xi:include href="Sda1/Exam/2020/Summer/Solve/Doc/tasks.xml"
xpointer="element(/1)"/>
</section>
</appendix>
</part>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment