NOTICKET: Cleanup

Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
This commit is contained in:
Dominik Säume 2024-04-28 22:17:19 +02:00
parent a3cbf3a940
commit b2dca20ac4
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
9 changed files with 9 additions and 15 deletions

View file

@ -5,7 +5,7 @@ import java.util.ArrayList;
import java.util.List;
public abstract class DaoImp<T> implements Dao<T> {
protected Connection connection;
protected final Connection connection;
public DaoImp(Connection connection) {
this.connection = connection;

View file

@ -18,7 +18,7 @@ import static de.hitec.nhplus.utils.DateConverter.convertStringToLocalTime;
public class TreatmentFixture implements Fixture<Treatment>
{
private Map<String, Patient> patientsByName;
private final Map<String, Patient> patientsByName;
public TreatmentFixture(Map<String, Patient> patientsByName)
{

View file

@ -80,9 +80,7 @@ public class AllPatientController {
.getSelectionModel()
.selectedItemProperty()
.addListener((observableValue, oldPatient, newPatient) ->
{
AllPatientController.this.buttonDelete.setDisable(newPatient == null);
}
AllPatientController.this.buttonDelete.setDisable(newPatient == null)
);
this.buttonAdd.setDisable(true);

View file

@ -4,7 +4,6 @@ import de.hitec.nhplus.main.Person;
import de.hitec.nhplus.treatment.Treatment;
import de.hitec.nhplus.utils.DateConverter;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleLongProperty;
import javafx.beans.property.SimpleStringProperty;
import java.time.LocalDate;

View file

@ -70,9 +70,7 @@ public class AllTreatmentController {
.getSelectionModel()
.selectedItemProperty()
.addListener((observableValue, oldTreatment, newTreatment) ->
{
AllTreatmentController.this.buttonDelete.setDisable(newTreatment == null);
}
AllTreatmentController.this.buttonDelete.setDisable(newTreatment == null)
);
this.createComboBoxData();

View file

@ -60,11 +60,11 @@ public class Treatment {
}
public void setBegin(String begin) {
this.begin = DateConverter.convertStringToLocalTime(begin);;
this.begin = DateConverter.convertStringToLocalTime(begin);
}
public void setEnd(String end) {
this.end = DateConverter.convertStringToLocalTime(end);;
this.end = DateConverter.convertStringToLocalTime(end);
}
public String getDescription() {

View file

@ -47,7 +47,7 @@ public class TreatmentController {
PatientDao pDao = DaoFactory.getDaoFactory().createPatientDAO();
try {
this.patient = pDao.read((int) treatment.getPatientId());
this.patient = pDao.read(treatment.getPatientId());
this.treatment = treatment;
showData();
} catch (SQLException exception) {

View file

@ -23,7 +23,7 @@ public class TreatmentDao extends DaoImp<Treatment> {
final String SQL = "INSERT INTO treatment (patientId, treatment_date, begin, end, description, remark) " +
"VALUES (?, ?, ?, ?, ?, ?)";
preparedStatement = this.connection.prepareStatement(SQL);
preparedStatement.setLong(1, treatment.getPatientId());
preparedStatement.setInt(1, treatment.getPatientId());
preparedStatement.setString(2, treatment.getDate());
preparedStatement.setString(3, treatment.getBegin());
preparedStatement.setString(4, treatment.getEnd());
@ -128,7 +128,7 @@ public class TreatmentDao extends DaoImp<Treatment> {
preparedStatement.setString(4, treatment.getEnd());
preparedStatement.setString(5, treatment.getDescription());
preparedStatement.setString(6, treatment.getRemarks());
preparedStatement.setLong(7, treatment.getId());
preparedStatement.setInt(7, treatment.getId());
} catch (SQLException exception) {
exception.printStackTrace();
}

View file

@ -1,7 +1,6 @@
module de.hitec.nhplus {
requires javafx.controls;
requires javafx.fxml;
requires org.controlsfx.controls;
requires java.sql;
requires org.xerial.sqlitejdbc;