diff --git a/db/nursingHome.db b/db/nursingHome.db index a68eab3..49707f4 100644 Binary files a/db/nursingHome.db and b/db/nursingHome.db differ 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">