From 1827e8caf6f2ef3ee9c680449b52012bfbcba450 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20S=C3=A4ume?= Date: Mon, 6 May 2024 09:30:03 +0200 Subject: [PATCH] #32: Make Consistent Naming MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Dominik Säume --- .idea/dataSources.xml | 2 +- .idea/sqlDataSources.xml | 35 +++++++ db/nursingHome.db | Bin 20480 -> 20480 bytes .../java/de/hitec/nhplus/main/Person.java | 18 ++-- .../nhplus/nurse/AllNurseController.java | 26 ++--- .../java/de/hitec/nhplus/nurse/Nurse.java | 12 +-- .../hitec/nhplus/nurse/database/NurseDao.java | 10 +- .../nhplus/patient/AllPatientController.java | 18 ++-- .../java/de/hitec/nhplus/patient/Patient.java | 12 +-- .../nhplus/patient/database/PatientDao.java | 14 +-- .../treatment/AllTreatmentController.java | 15 ++- .../de/hitec/nhplus/treatment/Treatment.java | 91 ++++++++++++------ .../treatment/TreatmentModalController.java | 2 +- .../treatment/database/TreatmentDao.java | 4 +- .../de/hitec/nhplus/nurse/AllNurseView.fxml | 6 +- .../de/hitec/nhplus/nurse/database/Nurse.sql | 6 +- .../hitec/nhplus/patient/AllPatientView.fxml | 4 +- .../hitec/nhplus/patient/database/Patient.sql | 8 +- .../nhplus/treatment/AllTreatmentView.fxml | 6 +- .../nhplus/treatment/database/Treatment.sql | 16 +-- 20 files changed, 187 insertions(+), 118 deletions(-) create mode 100644 .idea/sqlDataSources.xml diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 98f48a2..fed79a7 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -1,7 +1,7 @@ - + sqlite.xerial true org.sqlite.JDBC diff --git a/.idea/sqlDataSources.xml b/.idea/sqlDataSources.xml new file mode 100644 index 0000000..e75a467 --- /dev/null +++ b/.idea/sqlDataSources.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/db/nursingHome.db b/db/nursingHome.db index f25badf0e50452f1f1ae63b41747e16a5b5374df..2f42a9d3d3514a912207d2b54e56471170d2b12e 100644 GIT binary patch delta 884 zcmZozz}T>Wae|Z(6B`2q11k{2K>0)+BQc<;UeQ8co&yXl-1ZE7t9e&&+w;8K*m#ELf0Ol9`%U;t7)T^b2uycMVeT z^AAz*3-$5Q0jo$!EJ=lGQwVX52m!HCRV1aRXXZhbU{{fvhp-!_!XMR;l+@znqRfJl z%=|nY))b}YCKhEw?134AWX9xFJ{LAFO}@Vjnv;+4sB$&hn6QhBi!(NbPd>$?gd-3# zz+OztEGjPXOUwoN6Kpb)u|T2X(jurNR_TI_{Jd1Z(%hufB2?X6noSHw?BdeWjLqSb z75O!AxWS%6H%wm1FJ}ifBRR1s)hD$qH3z#tit_Vwq3%R;=;T#=p&X3NL&2$=|MN2o z@LXhI=0C*A|BC+*|NYH^4lDT`dBvIK8B2;%6H9n`m0`?WVAAFS<{Cc6ywalLR3;#k YQ-xU^%HvjImS%)z05-PGKlC{i01}qkssI20 delta 599 zcmZozz}T>Wae|Z(;~WMC238=3f#``kMq)rwy`qJ@e192Ocn&b|t>zc!jpI46Sx~{7 zhqbX$T8(}35gt|cqT*Bqjm(tEj{M373Tc@|#U*)(xv2^vt`Q*$e*Qol>f@uMP+VGs zMR;-#uN1dtlb0&HxV$`LOY&q-ZasDd4Fv@Sh=KJ$mO?>dNoHzZiD!y}r(cMxyK4}V zu|VmPqSVBaT%dyZl*AGYdw~j)Qqwc@(A@(RPt8lgBASv~oLrPyP?DJs)T4ŽE; z)ZE0PY&3n7t9V=(6(+CZ3squ}5|@@{Yz{9;Ov*_uNMvJEV*`h2W10#(SVnm=JHH09 zAI*TK;tn^U9FCy# columnFirstName; @FXML - private TableColumn columnSurname; + private TableColumn columnSurName; @FXML private TableColumn columnPhoneNumber; @@ -48,8 +48,8 @@ public class AllNurseController { this.columnFirstName.setCellValueFactory(new PropertyValueFactory<>("firstName")); this.columnFirstName.setCellFactory(TextFieldTableCell.forTableColumn()); - this.columnSurname.setCellValueFactory(new PropertyValueFactory<>("surname")); - this.columnSurname.setCellFactory(TextFieldTableCell.forTableColumn()); + this.columnSurName.setCellValueFactory(new PropertyValueFactory<>("surName")); + this.columnSurName.setCellFactory(TextFieldTableCell.forTableColumn()); this.columnPhoneNumber.setCellValueFactory(new PropertyValueFactory<>("phoneNumber")); @@ -60,15 +60,15 @@ public class AllNurseController { this.buttonAdd.setDisable(true); ChangeListener inputNewNurseValidationListener = (observableValue, oldText, newText)-> { - boolean isValid = isValidFirstName(this.textFieldFirstname.getText()) - && isValidSurName(this.textFieldSurname.getText()) + boolean isValid = isValidFirstName(this.textFieldFirstName.getText()) + && isValidSurName(this.textFieldSurName.getText()) && isValidPhoneNumber(this.textFieldPhoneNumber.getText()); AllNurseController.this.buttonAdd.setDisable(!isValid); }; - this.textFieldFirstname.textProperty().addListener(inputNewNurseValidationListener); - this.textFieldSurname.textProperty().addListener(inputNewNurseValidationListener); + this.textFieldFirstName.textProperty().addListener(inputNewNurseValidationListener); + this.textFieldSurName.textProperty().addListener(inputNewNurseValidationListener); this.textFieldPhoneNumber.textProperty().addListener(inputNewNurseValidationListener); } @@ -83,8 +83,8 @@ public class AllNurseController { } @FXML public void handleAdd(){ - String surname=this.textFieldSurname.getText(); - String firstName=this.textFieldFirstname.getText(); + String surname=this.textFieldSurName.getText(); + String firstName=this.textFieldFirstName.getText(); String phoneNumber=this.textFieldPhoneNumber.getText(); try { this.dao.create(new Nurse(firstName, surname, phoneNumber)); @@ -97,8 +97,8 @@ public class AllNurseController { } private void clearTextfields() { - this.textFieldFirstname.clear(); - this.textFieldSurname.clear(); + this.textFieldFirstName.clear(); + this.textFieldSurName.clear(); this.textFieldPhoneNumber.clear(); } diff --git a/src/main/java/de/hitec/nhplus/nurse/Nurse.java b/src/main/java/de/hitec/nhplus/nurse/Nurse.java index 7243cc0..18e87f1 100644 --- a/src/main/java/de/hitec/nhplus/nurse/Nurse.java +++ b/src/main/java/de/hitec/nhplus/nurse/Nurse.java @@ -12,20 +12,20 @@ public class Nurse extends Person { public Nurse( String firstName, - String surname, + String surName, String phoneNumber ) { - super(firstName, surname); + super(firstName, surName); this.phoneNumber = new SimpleStringProperty(phoneNumber); } public Nurse( int id, String firstName, - String surname, + String surName, String phoneNumber ) { - super(firstName, surname); + super(firstName, surName); this.id = new SimpleIntegerProperty(id); this.phoneNumber = new SimpleStringProperty(phoneNumber); } @@ -55,8 +55,8 @@ public class Nurse extends Person { return new StringJoiner(System.lineSeparator()) .add("NURSE") .add("ID: " + this.getId()) - .add("Firstname: " + this.getFirstName()) - .add("Surname: " + this.getSurname()) + .add("FirstName: " + this.getFirstName()) + .add("SurName: " + this.getSurName()) .add("PhoneNumber: " + this.getPhoneNumber()) .toString(); diff --git a/src/main/java/de/hitec/nhplus/nurse/database/NurseDao.java b/src/main/java/de/hitec/nhplus/nurse/database/NurseDao.java index 0c967b6..a86fcbd 100644 --- a/src/main/java/de/hitec/nhplus/nurse/database/NurseDao.java +++ b/src/main/java/de/hitec/nhplus/nurse/database/NurseDao.java @@ -19,12 +19,12 @@ public class NurseDao extends DaoImp { protected PreparedStatement getCreateStatement(Nurse nurse) throws SQLException { final String SQL = """ INSERT INTO nurse - (firstname, surname, phoneNumber) + (firstName, surName, phoneNumber) VALUES (?, ?, ?) """; PreparedStatement statement = this.connection.prepareStatement(SQL); statement.setString(1, nurse.getFirstName()); - statement.setString(2, nurse.getSurname()); + statement.setString(2, nurse.getSurName()); statement.setString(3, nurse.getPhoneNumber()); return statement; } @@ -66,14 +66,14 @@ public class NurseDao extends DaoImp { protected PreparedStatement getUpdateStatement(Nurse nurse) throws SQLException { final String SQL = """ UPDATE nurse SET - firstname = ?, - surname = ?, + firstName = ?, + surName = ?, phoneNumber = ? WHERE id = ? """; PreparedStatement statement = this.connection.prepareStatement(SQL); statement.setString(1, nurse.getFirstName()); - statement.setString(2, nurse.getSurname()); + statement.setString(2, nurse.getSurName()); statement.setString(3, nurse.getPhoneNumber()); statement.setInt(4, nurse.getId()); return statement; diff --git a/src/main/java/de/hitec/nhplus/patient/AllPatientController.java b/src/main/java/de/hitec/nhplus/patient/AllPatientController.java index 592223a..e9df51d 100644 --- a/src/main/java/de/hitec/nhplus/patient/AllPatientController.java +++ b/src/main/java/de/hitec/nhplus/patient/AllPatientController.java @@ -28,7 +28,7 @@ public class AllPatientController { @FXML private TableColumn columnFirstName; @FXML - private TableColumn columnSurname; + private TableColumn columnSurName; @FXML private TableColumn columnDateOfBirth; @FXML @@ -40,7 +40,7 @@ public class AllPatientController { @FXML private Button buttonAdd; @FXML - private TextField textFieldSurname; + private TextField textFieldSurName; @FXML private TextField textFieldFirstName; @FXML @@ -61,8 +61,8 @@ public class AllPatientController { this.columnFirstName.setCellValueFactory(new PropertyValueFactory<>("firstName")); this.columnFirstName.setCellFactory(TextFieldTableCell.forTableColumn()); - this.columnSurname.setCellValueFactory(new PropertyValueFactory<>("surname")); - this.columnSurname.setCellFactory(TextFieldTableCell.forTableColumn()); + this.columnSurName.setCellValueFactory(new PropertyValueFactory<>("surName")); + this.columnSurName.setCellFactory(TextFieldTableCell.forTableColumn()); this.columnDateOfBirth.setCellValueFactory(new PropertyValueFactory<>("dateOfBirth")); this.columnDateOfBirth.setCellFactory(TextFieldTableCell.forTableColumn()); @@ -89,7 +89,7 @@ public class AllPatientController { { boolean isValid = isValidDate(this.textFieldDateOfBirth.getText()) && isValidFirstName(this.textFieldFirstName.getText()) - && isValidSurName(this.textFieldSurname.getText()) + && isValidSurName(this.textFieldSurName.getText()) && isValidDate(this.textFieldDateOfBirth.getText()) && isValidCareLevel(this.textFieldCareLevel.getText()) && isValidRoomNumber(textFieldRoomNumber.getText()); @@ -97,7 +97,7 @@ public class AllPatientController { AllPatientController.this.buttonAdd.setDisable(!isValid); }; - this.textFieldSurname.textProperty().addListener(inputNewPatientValidationListener); + this.textFieldSurName.textProperty().addListener(inputNewPatientValidationListener); this.textFieldFirstName.textProperty().addListener(inputNewPatientValidationListener); this.textFieldDateOfBirth.textProperty().addListener(inputNewPatientValidationListener); this.textFieldCareLevel.textProperty().addListener(inputNewPatientValidationListener); @@ -124,7 +124,7 @@ public class AllPatientController { event.getTableView().refresh(); return; } - event.getRowValue().setSurname(newSurName); + event.getRowValue().setSurName(newSurName); this.doUpdate(event); } @@ -198,7 +198,7 @@ public class AllPatientController { @FXML public void handleAdd() { - String surname = this.textFieldSurname.getText(); + String surname = this.textFieldSurName.getText(); String firstName = this.textFieldFirstName.getText(); String birthday = this.textFieldDateOfBirth.getText(); LocalDate date = DateConverter.convertStringToLocalDate(birthday); @@ -215,7 +215,7 @@ public class AllPatientController { private void clearTextfields() { this.textFieldFirstName.clear(); - this.textFieldSurname.clear(); + this.textFieldSurName.clear(); this.textFieldDateOfBirth.clear(); this.textFieldCareLevel.clear(); this.textFieldRoomNumber.clear(); diff --git a/src/main/java/de/hitec/nhplus/patient/Patient.java b/src/main/java/de/hitec/nhplus/patient/Patient.java index 1b9928d..c7c72ee 100644 --- a/src/main/java/de/hitec/nhplus/patient/Patient.java +++ b/src/main/java/de/hitec/nhplus/patient/Patient.java @@ -20,12 +20,12 @@ public class Patient extends Person { public Patient( String firstName, - String surname, + String surName, LocalDate dateOfBirth, String careLevel, String roomNumber ) { - super(firstName, surname); + super(firstName, surName); this.dateOfBirth = new SimpleStringProperty(DateConverter.convertLocalDateToString(dateOfBirth)); this.careLevel = new SimpleStringProperty(careLevel); this.roomNumber = new SimpleStringProperty(roomNumber); @@ -34,12 +34,12 @@ public class Patient extends Person { public Patient( int id, String firstName, - String surname, + String surName, LocalDate dateOfBirth, String careLevel, String roomNumber ) { - super(firstName, surname); + super(firstName, surName); this.id = new SimpleIntegerProperty(id); this.dateOfBirth = new SimpleStringProperty(DateConverter.convertLocalDateToString(dateOfBirth)); this.careLevel = new SimpleStringProperty(careLevel); @@ -103,8 +103,8 @@ public class Patient extends Person { return new StringJoiner(System.lineSeparator()) .add("PATIENT") .add("ID: " + this.getId()) - .add("Firstname: " + this.getFirstName()) - .add("Surname: " + this.getSurname()) + .add("FirstName: " + this.getFirstName()) + .add("SurName: " + this.getSurName()) .add("Birthday: " + this.getDateOfBirth()) .add("Carelevel: " + this.getCareLevel()) .add("RoomNumber: " + this.getRoomNumber()) diff --git a/src/main/java/de/hitec/nhplus/patient/database/PatientDao.java b/src/main/java/de/hitec/nhplus/patient/database/PatientDao.java index 3d16e8a..90ba560 100644 --- a/src/main/java/de/hitec/nhplus/patient/database/PatientDao.java +++ b/src/main/java/de/hitec/nhplus/patient/database/PatientDao.java @@ -21,12 +21,12 @@ public class PatientDao extends DaoImp { protected PreparedStatement getCreateStatement(Patient patient) throws SQLException { final String SQL = """ INSERT INTO patient - (firstname, surname, dateOfBirth, carelevel, roomnumber) + (firstName, surName, dateOfBirth, careLevel, roomNumber) VALUES (?, ?, ?, ?, ?) """; PreparedStatement statement = this.connection.prepareStatement(SQL); statement.setString(1, patient.getFirstName()); - statement.setString(2, patient.getSurname()); + statement.setString(2, patient.getSurName()); statement.setString(3, patient.getDateOfBirth()); statement.setString(4, patient.getCareLevel()); statement.setString(5, patient.getRoomNumber()); @@ -71,16 +71,16 @@ public class PatientDao extends DaoImp { protected PreparedStatement getUpdateStatement(Patient patient) throws SQLException { final String SQL = """ UPDATE patient SET - firstname = ?, - surname = ?, + firstName = ?, + surName = ?, dateOfBirth = ?, - carelevel = ?, - roomnumber = ?, + careLevel = ?, + roomNumber = ?, WHERE id = ? """; PreparedStatement statement = this.connection.prepareStatement(SQL); statement.setString(1, patient.getFirstName()); - statement.setString(2, patient.getSurname()); + statement.setString(2, patient.getSurName()); statement.setString(3, patient.getDateOfBirth()); statement.setString(4, patient.getCareLevel()); statement.setString(5, patient.getRoomNumber()); diff --git a/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java b/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java index b0b5f26..fd982ae 100644 --- a/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java +++ b/src/main/java/de/hitec/nhplus/treatment/AllTreatmentController.java @@ -5,6 +5,8 @@ import de.hitec.nhplus.datastorage.DaoFactory; import de.hitec.nhplus.patient.Patient; import de.hitec.nhplus.patient.database.PatientDao; import de.hitec.nhplus.treatment.database.TreatmentDao; +import javafx.beans.property.SimpleIntegerProperty; +import javafx.beans.property.SimpleStringProperty; import javafx.collections.FXCollections; import javafx.collections.ObservableList; import javafx.fxml.FXML; @@ -28,7 +30,7 @@ public class AllTreatmentController { private TableColumn columnId; @FXML - private TableColumn columnPatientId; + private TableColumn columnPatientName; @FXML private TableColumn columnDate; @@ -59,7 +61,12 @@ public class AllTreatmentController { comboBoxPatientSelection.getSelectionModel().select(0); this.columnId.setCellValueFactory(new PropertyValueFactory<>("id")); - this.columnPatientId.setCellValueFactory(new PropertyValueFactory<>("patientId")); + this.columnPatientName.setCellValueFactory( + cellData -> { + Patient patient = cellData.getValue().getPatient(); + return new SimpleStringProperty(patient.getSurName() + ", " + patient.getFirstName()); + } + ); this.columnDate.setCellValueFactory(new PropertyValueFactory<>("date")); this.columnBegin.setCellValueFactory(new PropertyValueFactory<>("begin")); this.columnEnd.setCellValueFactory(new PropertyValueFactory<>("end")); @@ -93,7 +100,7 @@ public class AllTreatmentController { patientList = (ArrayList) dao.readAll(); this.patientSelection.add("alle"); for (Patient patient : patientList) { - this.patientSelection.add(patient.getSurname()); + this.patientSelection.add(patient.getSurName()); } } catch (SQLException exception) { exception.printStackTrace(); @@ -127,7 +134,7 @@ public class AllTreatmentController { private Patient searchInList(String surname) { for (Patient patient : this.patientList) { - if (patient.getSurname().equals(surname)) { + if (patient.getSurName().equals(surname)) { return patient; } } diff --git a/src/main/java/de/hitec/nhplus/treatment/Treatment.java b/src/main/java/de/hitec/nhplus/treatment/Treatment.java index fb15f06..61c5c85 100644 --- a/src/main/java/de/hitec/nhplus/treatment/Treatment.java +++ b/src/main/java/de/hitec/nhplus/treatment/Treatment.java @@ -2,94 +2,121 @@ package de.hitec.nhplus.treatment; import de.hitec.nhplus.patient.Patient; import de.hitec.nhplus.utils.DateConverter; +import javafx.beans.property.SimpleIntegerProperty; +import javafx.beans.property.SimpleObjectProperty; +import javafx.beans.property.SimpleStringProperty; import java.time.LocalDate; import java.time.LocalTime; import java.util.StringJoiner; public class Treatment { - private int id; - private final Patient patient; - private LocalDate date; - private LocalTime begin; - private LocalTime end; - private String description; - private String remarks; + private SimpleIntegerProperty id; + private final SimpleObjectProperty patient; + private final SimpleObjectProperty date; + private final SimpleObjectProperty begin; + private final SimpleObjectProperty end; + private final SimpleStringProperty description; + private final SimpleStringProperty remarks; public Treatment(Patient patient, LocalDate date, LocalTime begin, LocalTime end, String description, String remarks) { - this.patient = patient; - this.date = date; - this.begin = begin; - this.end = end; - this.description = description; - this.remarks = remarks; + this.patient = new SimpleObjectProperty<>(patient); + this.date = new SimpleObjectProperty<>(date); + this.begin = new SimpleObjectProperty<>(begin); + this.end = new SimpleObjectProperty<>(end); + this.description = new SimpleStringProperty(description); + this.remarks = new SimpleStringProperty(remarks); } public Treatment(int id, Patient patient, LocalDate date, LocalTime begin, LocalTime end, String description, String remarks) { - this.id = id; - this.patient = patient; - this.date = date; - this.begin = begin; - this.end = end; - this.description = description; - this.remarks = remarks; + this.id = new SimpleIntegerProperty(id); + this.patient = new SimpleObjectProperty<>(patient); + this.date = new SimpleObjectProperty<>(date); + this.begin = new SimpleObjectProperty<>(begin); + this.end = new SimpleObjectProperty<>(end); + this.description = new SimpleStringProperty(description); + this.remarks = new SimpleStringProperty(remarks); } public int getId() { - return id; + return id.getValue(); } public Patient getPatient() { - return this.patient; + return patient.getValue(); } public String getDate() { - return date.toString(); + return date.getValue().toString(); } public String getBegin() { - return begin.toString(); + return begin.getValue().toString(); } public String getEnd() { - return end.toString(); + return end.getValue().toString(); } public void setDate(String date) { - this.date = DateConverter.convertStringToLocalDate(date); + this.date.set(DateConverter.convertStringToLocalDate(date)); } public void setBegin(LocalTime begin) { - this.begin = begin; + this.begin.set(begin); } public void setEnd(LocalTime end) { - this.end = end; + this.end.set(end); } public String getDescription() { - return description; + return description.getValue(); } public void setDescription(String description) { - this.description = description; + this.description.set(description); } public String getRemarks() { + return remarks.getValue(); + } + + public SimpleObjectProperty patientProperty() { + return patient; + } + + public SimpleObjectProperty dateProperty() { + return date; + } + + public SimpleObjectProperty beginProperty() { + return begin; + } + + public SimpleObjectProperty endProperty() { + return end; + } + + public SimpleStringProperty descriptionProperty() { + return description; + } + + public SimpleStringProperty remarksProperty() { return remarks; } public void setRemarks(String remarks) { - this.remarks = remarks; + this.remarks.set(remarks); } public String toString() { return new StringJoiner(System.lineSeparator()) .add("TREATMENT") .add("ID: " + this.getId()) - .add("Patient: " + this.getPatient().getSurname() + " " + this.getPatient().getFirstName()) + .add("Patient: " + this.getPatient().getSurName() + " " + this.getPatient().getFirstName()) .add("Date: " + this.getDate()) .add("Begin: " + this.getBegin()) .add("End: " + this.getEnd()) diff --git a/src/main/java/de/hitec/nhplus/treatment/TreatmentModalController.java b/src/main/java/de/hitec/nhplus/treatment/TreatmentModalController.java index f6e4927..b3d4d9e 100644 --- a/src/main/java/de/hitec/nhplus/treatment/TreatmentModalController.java +++ b/src/main/java/de/hitec/nhplus/treatment/TreatmentModalController.java @@ -99,7 +99,7 @@ public class TreatmentModalController { private void showData() { this.labelFirstName.setText(patient.getFirstName()); - this.labelSurname.setText(patient.getSurname()); + this.labelSurname.setText(patient.getSurName()); LocalDate date = DateConverter.convertStringToLocalDate(treatment.getDate()); this.datePicker.setValue(date); this.textFieldBegin.setText(this.treatment.getBegin()); diff --git a/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java b/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java index 6a32e86..51ccde3 100644 --- a/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java +++ b/src/main/java/de/hitec/nhplus/treatment/database/TreatmentDao.java @@ -22,7 +22,7 @@ public class TreatmentDao extends DaoImp { protected PreparedStatement getCreateStatement(Treatment treatment) throws SQLException { final String SQL = """ INSERT INTO treatment - (patientId, treatment_date, begin, end, description, remark) + (patientId, date, begin, end, description, remark) VALUES (?, ?, ?, ?, ?, ?) """; PreparedStatement statement = this.connection.prepareStatement(SQL); @@ -88,7 +88,7 @@ public class TreatmentDao extends DaoImp { final String SQL = """ UPDATE treatment SET patientId = ?, - treatment_date = ?, + date = ?, begin = ?, end = ?, description = ?, diff --git a/src/main/resources/de/hitec/nhplus/nurse/AllNurseView.fxml b/src/main/resources/de/hitec/nhplus/nurse/AllNurseView.fxml index 4a7fb33..eec0384 100644 --- a/src/main/resources/de/hitec/nhplus/nurse/AllNurseView.fxml +++ b/src/main/resources/de/hitec/nhplus/nurse/AllNurseView.fxml @@ -20,7 +20,7 @@ text="ID" /> @@ -51,12 +51,12 @@ diff --git a/src/main/resources/de/hitec/nhplus/nurse/database/Nurse.sql b/src/main/resources/de/hitec/nhplus/nurse/database/Nurse.sql index d51bbf3..000823e 100644 --- a/src/main/resources/de/hitec/nhplus/nurse/database/Nurse.sql +++ b/src/main/resources/de/hitec/nhplus/nurse/database/Nurse.sql @@ -1,7 +1,7 @@ -CREATE TABLE IF NOT EXISTS nurse +CREATE TABLE nurse ( id INTEGER PRIMARY KEY AUTOINCREMENT, - firstname TEXT NOT NULL, - surname TEXT NOT NULL, + firstName TEXT NOT NULL, + surName TEXT NOT NULL, phoneNumber TEXT NOT NULL ) \ No newline at end of file diff --git a/src/main/resources/de/hitec/nhplus/patient/AllPatientView.fxml b/src/main/resources/de/hitec/nhplus/patient/AllPatientView.fxml index 9d63e7c..50941c6 100644 --- a/src/main/resources/de/hitec/nhplus/patient/AllPatientView.fxml +++ b/src/main/resources/de/hitec/nhplus/patient/AllPatientView.fxml @@ -23,7 +23,7 @@ text="ID" />