task/#17 Treatement -> Nurse Relation #36

Merged
SZUT-Dominik merged 4 commits from task/refactor-dao into main 2024-05-15 09:29:52 +00:00
3 changed files with 5 additions and 0 deletions
Showing only changes of commit a4e61157ef - Show all commits

View file

@ -18,6 +18,7 @@ public class Treatment {
private final SimpleObjectProperty<LocalTime> end; private final SimpleObjectProperty<LocalTime> end;
private final SimpleStringProperty description; private final SimpleStringProperty description;
private final SimpleStringProperty remarks; private final SimpleStringProperty remarks;
//TODO: Add Nurse
public Treatment(Patient patient, LocalDate date, LocalTime begin, public Treatment(Patient patient, LocalDate date, LocalTime begin,
LocalTime end, String description, String remarks) { LocalTime end, String description, String remarks) {

View file

@ -12,6 +12,7 @@ import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
//TODO: Update Methods to use a new Nurse Field (cascade this to any class using this DAO)
public class TreatmentDao extends DaoImp<Treatment> { public class TreatmentDao extends DaoImp<Treatment> {
public TreatmentDao(Connection connection) { public TreatmentDao(Connection connection) {
@ -83,6 +84,8 @@ public class TreatmentDao extends DaoImp<Treatment> {
return getListFromResultSet(result); return getListFromResultSet(result);
} }
//TODO: readTreatmentsByNurse
@Override @Override
protected PreparedStatement getUpdateStatement(Treatment treatment) throws SQLException { protected PreparedStatement getUpdateStatement(Treatment treatment) throws SQLException {
final String SQL = """ final String SQL = """

View file

@ -8,4 +8,5 @@ CREATE TABLE treatment
description TEXT NOT NULL, description TEXT NOT NULL,
remark TEXT NOT NULL, remark TEXT NOT NULL,
FOREIGN KEY (patientId) REFERENCES patient (id) ON DELETE CASCADE FOREIGN KEY (patientId) REFERENCES patient (id) ON DELETE CASCADE
-- TODO: Add Nurse
) )