NOTICKET: Cleanup
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
This commit is contained in:
parent
1cbe39b481
commit
8cb52b4162
9 changed files with 9 additions and 15 deletions
|
@ -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;
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue