From 8302543c30ccedfcb760af684480c1d5738efadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Mon, 29 Apr 2024 14:49:23 +0200 Subject: [PATCH] NOTICKET: Mergin Structure of Refactor & Nurse Module Together MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dominik Säume --- db/nursingHome.db | Bin 16384 -> 20480 bytes .../hitec/nhplus/datastorage/DaoFactory.java | 1 + .../hitec/nhplus/fixtures/NurseFixture.java | 4 ++-- .../nhplus/main/MainWindowController.java | 10 ---------- .../AllNurseController.java | 4 +--- .../hitec/nhplus/{model => nurse}/Nurse.java | 3 ++- .../{datastorage => nurse}/NurseDao.java | 12 ++++++------ src/main/java/module-info.java | 3 +++ .../nhplus/{ => nurse}/AllNurseView.fxml | 2 +- 9 files changed, 16 insertions(+), 23 deletions(-) rename src/main/java/de/hitec/nhplus/{treatment => nurse}/AllNurseController.java (94%) rename src/main/java/de/hitec/nhplus/{model => nurse}/Nurse.java (94%) rename src/main/java/de/hitec/nhplus/{datastorage => nurse}/NurseDao.java (92%) rename src/main/resources/de/hitec/nhplus/{ => nurse}/AllNurseView.fxml (98%) diff --git a/db/nursingHome.db b/db/nursingHome.db index a68eab37a274c428b18cb78f60de7bd16e353e49..49707f4ed52ea72b2027af5df72c7f23da27e603 100644 GIT binary patch delta 350 zcmZo@U~E{xI6+E?k%xhSffa~hzPkr+@^uV^7J-(Ln6p8X7btNF!w<9POOZ1m>Q zZf@uMP+VGsO}HQlb6WmMBep`T%v4X2REh( zZ8gRr=we@?3R;XTRO28Kq)CZ=ZQ7M1{18eBdA delta 149 zcmZozz}V2hI6+E?;VT0J0}BwtfYC%9BN3peUeQ8czP}92ym1VCtNF!w<2DN_yy0PP z@)Fvd$h)4AONb4uqcKfzvlRbx0dD>$3{3pj8TqgCe*mgH%s(-JRg0IKlbe}Ynz10U hBr`Ry1f+w9v7{(9u_QN@mxWm##?C9*{7;`r0075fBw_#n diff --git a/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java b/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java index 17b55fb..a109f59 100644 --- a/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java +++ b/src/main/java/de/hitec/nhplus/datastorage/DaoFactory.java @@ -1,5 +1,6 @@ package de.hitec.nhplus.datastorage; +import de.hitec.nhplus.nurse.NurseDao; import de.hitec.nhplus.patient.PatientDao; import de.hitec.nhplus.treatment.TreatmentDao; diff --git a/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java b/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java index aab03e7..2bbb2ce 100644 --- a/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java +++ b/src/main/java/de/hitec/nhplus/fixtures/NurseFixture.java @@ -1,8 +1,8 @@ package de.hitec.nhplus.fixtures; import de.hitec.nhplus.datastorage.DaoFactory; -import de.hitec.nhplus.datastorage.NurseDao; -import de.hitec.nhplus.model.Nurse; +import de.hitec.nhplus.nurse.NurseDao; +import de.hitec.nhplus.nurse.Nurse; import java.sql.Connection; import java.sql.SQLException; diff --git a/src/main/java/de/hitec/nhplus/main/MainWindowController.java b/src/main/java/de/hitec/nhplus/main/MainWindowController.java index 21b8da1..d76ea67 100644 --- a/src/main/java/de/hitec/nhplus/main/MainWindowController.java +++ b/src/main/java/de/hitec/nhplus/main/MainWindowController.java @@ -57,14 +57,4 @@ public class MainWindowController { exception.printStackTrace(); } } - - @FXML - private void handleShowAllNurses(ActionEvent event){ - FXMLLoader loader = new FXMLLoader(Main.class.getResource("/de/hitec/nhplus/AllNurseView.fxml")); - try { - mainBorderPane.setCenter(loader.load()); - }catch (IOException exception){ - exception.printStackTrace(); - } - } } diff --git a/src/main/java/de/hitec/nhplus/treatment/AllNurseController.java b/src/main/java/de/hitec/nhplus/nurse/AllNurseController.java similarity index 94% rename from src/main/java/de/hitec/nhplus/treatment/AllNurseController.java rename to src/main/java/de/hitec/nhplus/nurse/AllNurseController.java index 3bd75bb..2c5e36e 100644 --- a/src/main/java/de/hitec/nhplus/treatment/AllNurseController.java +++ b/src/main/java/de/hitec/nhplus/nurse/AllNurseController.java @@ -1,8 +1,6 @@ -package de.hitec.nhplus.controller; +package de.hitec.nhplus.nurse; import de.hitec.nhplus.datastorage.DaoFactory; -import de.hitec.nhplus.datastorage.NurseDao; -import de.hitec.nhplus.model.Nurse; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; diff --git a/src/main/java/de/hitec/nhplus/model/Nurse.java b/src/main/java/de/hitec/nhplus/nurse/Nurse.java similarity index 94% rename from src/main/java/de/hitec/nhplus/model/Nurse.java rename to src/main/java/de/hitec/nhplus/nurse/Nurse.java index 20790e3..25f3cf2 100644 --- a/src/main/java/de/hitec/nhplus/model/Nurse.java +++ b/src/main/java/de/hitec/nhplus/nurse/Nurse.java @@ -1,5 +1,6 @@ -package de.hitec.nhplus.model; +package de.hitec.nhplus.nurse; +import de.hitec.nhplus.main.Person; import javafx.beans.property.SimpleLongProperty; import javafx.beans.property.SimpleStringProperty; diff --git a/src/main/java/de/hitec/nhplus/datastorage/NurseDao.java b/src/main/java/de/hitec/nhplus/nurse/NurseDao.java similarity index 92% rename from src/main/java/de/hitec/nhplus/datastorage/NurseDao.java rename to src/main/java/de/hitec/nhplus/nurse/NurseDao.java index 1400e5d..fce3b4d 100644 --- a/src/main/java/de/hitec/nhplus/datastorage/NurseDao.java +++ b/src/main/java/de/hitec/nhplus/nurse/NurseDao.java @@ -1,6 +1,6 @@ -package de.hitec.nhplus.datastorage; +package de.hitec.nhplus.nurse; -import de.hitec.nhplus.model.Nurse; +import de.hitec.nhplus.datastorage.DaoImp; import java.sql.Connection; import java.sql.PreparedStatement; @@ -30,12 +30,12 @@ public class NurseDao extends DaoImp { } @Override - protected PreparedStatement getReadByIDStatement(long nid) { + protected PreparedStatement getReadByIDStatement(int nid) { PreparedStatement preparedStatement = null; try { final String SQL = "SELECT * FROM nurse WHERE nid = ?"; preparedStatement = this.connection.prepareStatement(SQL); - preparedStatement.setLong(1, nid); + preparedStatement.setInt(1, nid); } catch (SQLException exception) { exception.printStackTrace(); } @@ -101,12 +101,12 @@ public class NurseDao extends DaoImp { } @Override - protected PreparedStatement getDeleteStatement(long nid) { + protected PreparedStatement getDeleteStatement(int nid) { PreparedStatement preparedStatement = null; try { final String SQL = "DELETE FROM nurse WHERE nid = ?"; preparedStatement = this.connection.prepareStatement(SQL); - preparedStatement.setLong(1, nid); + preparedStatement.setInt(1, nid); } catch (SQLException exception) { exception.printStackTrace(); } diff --git a/src/main/java/module-info.java b/src/main/java/module-info.java index 7daa9d8..b707e16 100644 --- a/src/main/java/module-info.java +++ b/src/main/java/module-info.java @@ -15,4 +15,7 @@ module de.hitec.nhplus { exports de.hitec.nhplus.treatment; opens de.hitec.nhplus.treatment to javafx.base, javafx.fxml; + + exports de.hitec.nhplus.nurse; + opens de.hitec.nhplus.nurse to javafx.base, javafx.fxml; } diff --git a/src/main/resources/de/hitec/nhplus/AllNurseView.fxml b/src/main/resources/de/hitec/nhplus/nurse/AllNurseView.fxml similarity index 98% rename from src/main/resources/de/hitec/nhplus/AllNurseView.fxml rename to src/main/resources/de/hitec/nhplus/nurse/AllNurseView.fxml index d2840e0..c775e66 100644 --- a/src/main/resources/de/hitec/nhplus/AllNurseView.fxml +++ b/src/main/resources/de/hitec/nhplus/nurse/AllNurseView.fxml @@ -5,7 +5,7 @@ + xmlns:fx="http://javafx.com/fxml/1" fx:controller="de.hitec.nhplus.nurse.AllNurseController">