Datenbankstruktur hinzugefügt.

This commit is contained in:
Philipp 2020-11-08 14:29:03 +01:00
parent 01244b67ab
commit 79ad562b09
2 changed files with 64 additions and 13 deletions

View file

@ -7,14 +7,7 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="20f6192e-712c-4901-ab50-abe79c149ecf" name="Default Changelist" comment=""> <list default="true" id="20f6192e-712c-4901-ab50-abe79c149ecf" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/README.md" beforeDir="false" afterPath="$PROJECT_DIR$/README.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/artifacts/Autovermietung/Autovermietung.jar" beforeDir="false" afterPath="$PROJECT_DIR$/out/artifacts/Autovermietung/Autovermietung.jar" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/autovermietung-int/autovermietung/Main.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/autovermietung-int/autovermietung/Main.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/autovermietung-int/autovermietung/helper/Database.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/autovermietung-int/autovermietung/helper/Database.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/out/production/autovermietung-int/autovermietung/helper/Shop.class" beforeDir="false" afterPath="$PROJECT_DIR$/out/production/autovermietung-int/autovermietung/helper/Shop.class" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/autovermietung/Main.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/autovermietung/Main.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/autovermietung/helper/Database.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/autovermietung/helper/Database.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/autovermietung/helper/Shop.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/autovermietung/helper/Shop.java" afterDir="false" />
</list> </list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" /> <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
@ -44,10 +37,10 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true"> <file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/autovermietung/helper/Database.java"> <entry file="file://$PROJECT_DIR$/src/autovermietung/helper/Database.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391"> <state relative-caret-position="1479">
<caret line="87" selection-start-line="87" selection-end-line="87" /> <caret line="87" selection-start-line="87" selection-end-line="87" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
@ -56,6 +49,15 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="18" selection-start-line="18" selection-end-line="18" />
</state>
</provider>
</entry>
</file>
</leaf> </leaf>
</split-first> </split-first>
<split-second> <split-second>
@ -150,6 +152,7 @@
<option value="$PROJECT_DIR$/src/autovermietung/Main.java" /> <option value="$PROJECT_DIR$/src/autovermietung/Main.java" />
<option value="$PROJECT_DIR$/src/autovermietung/helper/Shop.java" /> <option value="$PROJECT_DIR$/src/autovermietung/helper/Shop.java" />
<option value="$PROJECT_DIR$/src/autovermietung/helper/Database.java" /> <option value="$PROJECT_DIR$/src/autovermietung/helper/Database.java" />
<option value="$PROJECT_DIR$/README.md" />
</list> </list>
</option> </option>
</component> </component>
@ -306,7 +309,7 @@
<layout> <layout>
<window_info id="Favorites" order="0" sideWeight="0.50117373" side_tool="true" weight="0.15063593" /> <window_info id="Favorites" order="0" sideWeight="0.50117373" side_tool="true" weight="0.15063593" />
<window_info id="Designer" order="1" /> <window_info id="Designer" order="1" />
<window_info content_ui="combo" id="Project" order="2" sideWeight="0.4988263" visible="true" weight="0.15302067" /> <window_info active="true" content_ui="combo" id="Project" order="2" sideWeight="0.4988263" visible="true" weight="0.15302067" />
<window_info id="Structure" order="3" sideWeight="0.5013123" side_tool="true" weight="0.15063593" /> <window_info id="Structure" order="3" sideWeight="0.5013123" side_tool="true" weight="0.15063593" />
<window_info anchor="bottom" id="Terminal" order="0" weight="0.32992125" /> <window_info anchor="bottom" id="Terminal" order="0" weight="0.32992125" />
<window_info anchor="bottom" id="Event Log" order="1" sideWeight="0.50039744" side_tool="true" weight="0.20866142" /> <window_info anchor="bottom" id="Event Log" order="1" sideWeight="0.50039744" side_tool="true" weight="0.20866142" />
@ -314,7 +317,7 @@
<window_info anchor="bottom" id="Message" order="3" /> <window_info anchor="bottom" id="Message" order="3" />
<window_info anchor="bottom" id="Version Control" order="4" /> <window_info anchor="bottom" id="Version Control" order="4" />
<window_info anchor="bottom" id="Find" order="5" weight="0.32992125" /> <window_info anchor="bottom" id="Find" order="5" weight="0.32992125" />
<window_info active="true" anchor="bottom" id="Run" order="6" sideWeight="0.49960256" visible="true" weight="0.20866142" /> <window_info anchor="bottom" id="Run" order="6" sideWeight="0.49960256" visible="true" weight="0.20866142" />
<window_info anchor="bottom" id="Debug" order="7" weight="0.4" /> <window_info anchor="bottom" id="Debug" order="7" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="8" weight="0.25" /> <window_info anchor="bottom" id="Cvs" order="8" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="9" weight="0.4" /> <window_info anchor="bottom" id="Inspection" order="9" weight="0.4" />
@ -489,7 +492,7 @@
</entry> </entry>
<entry file="file://$PROJECT_DIR$/src/autovermietung/helper/Database.java"> <entry file="file://$PROJECT_DIR$/src/autovermietung/helper/Database.java">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391"> <state relative-caret-position="1479">
<caret line="87" selection-start-line="87" selection-end-line="87" /> <caret line="87" selection-start-line="87" selection-end-line="87" />
<folding> <folding>
<element signature="imports" expanded="true" /> <element signature="imports" expanded="true" />
@ -497,6 +500,13 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/README.md">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="18" selection-start-line="18" selection-end-line="18" />
</state>
</provider>
</entry>
</component> </component>
<component name="masterDetails"> <component name="masterDetails">
<states> <states>

View file

@ -14,6 +14,47 @@ Es gibt eine database.properties Datei, in dieser sind alle nötigen Verbindungs
Sonst könnt Ihr die ganze Suppe mit der Jar-File einfach in der cmd/PowerShell oder was auch immer Ihr benutzt mit `java -jar autovermietung.jar` ausführen. Sonst könnt Ihr die ganze Suppe mit der Jar-File einfach in der cmd/PowerShell oder was auch immer Ihr benutzt mit `java -jar autovermietung.jar` ausführen.
### Aufsetzen der MySQL Datenbank
Zum erstellen der Datenbank wird diese Struktur verwendet.
`
CREATE TABLE kunde (
knr integer auto_increment,
vorname varchar(10) not null,
nachname varchar(10) not null,
anschrift varchar(50) not null,
telefon varchar(15) not null,
personr integer not null,
PRIMARY KEY (knr)
)ENGINE=INNODB AUTO_INCREMENT=1;
CREATE TABLE modell (
mnr integer auto_increment,
modellname varchar(20) not null,
hubraum integer not null,
leistung integer not null,
kmpreis float not null,
pauschale float not null,
PRIMARY KEY (mnr)
)ENGINE=INNODB AUTO_INCREMENT=1;
CREATE TABLE pkw (
kennzeichen varchar(9),
erstzulassung date not null,
tachostand integer not null,
farbe varchar(6) not null,
ausleihdatum date,
mnr integer,
knr integer,
PRIMARY KEY (kennzeichen),
FOREIGN KEY (mnr) REFERENCES modell(mnr)
ON DELETE RESTRICT ON UPDATE CASCADE,
FOREIGN KEY (knr) REFERENCES kunde(knr)
ON DELETE RESTRICT ON UPDATE CASCADE
)ENGINE=INNODB;
`
### Sonstiges ### Sonstiges
____ ____
Hab nur in der Main Kommentare reingepackt, der Rest war mir irgendwie egal und ich hab dadran sowieso zu lange gesessen. Wenn irgendwas unklar sein sollte fragt einfach, ansonsten mal schauen vielleicht hab ich nochmal Lust es zu kommentieren. Aber denke eher nicht. Hab nur in der Main Kommentare reingepackt, der Rest war mir irgendwie egal und ich hab dadran sowieso zu lange gesessen. Wenn irgendwas unklar sein sollte fragt einfach, ansonsten mal schauen vielleicht hab ich nochmal Lust es zu kommentieren. Aber denke eher nicht.