NOTICKET: Fix Javadoc Generation
All checks were successful
Quality Check / Qualty Check (push) Successful in 14s
Javadoc Deploy / Javadoc (push) Successful in 26s

Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
This commit is contained in:
Dominik Säume 2024-05-07 15:37:46 +02:00
parent f5dc9c3343
commit 85cfe4fff9
Signed by: SZUT-Dominik
GPG key ID: 67D15BB250B41E7C
7 changed files with 94 additions and 34 deletions

15
pom.xml
View file

@ -21,12 +21,12 @@
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>20.0.1</version>
<version>21.0.2</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>20.0.1</version>
<version>21.0.2</version>
</dependency>
<dependency>
<groupId>org.controlsfx</groupId>
@ -112,11 +112,20 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.3</version>
<configuration>
<source>21</source>
<release>21</release>
<author>true</author>
<doclint>all,-missing</doclint>
<reportOutputDirectory>${project.basedir}</reportOutputDirectory>
<sourcepath>src/main/java</sourcepath>
<destDir>javadoc_build</destDir>
<tags>
<tag>
<name>implSpec</name>
</tag>
</tags>
</configuration>
</plugin>
</plugins>

View file

@ -10,6 +10,7 @@ import java.sql.SQLException;
* The {@link DaoFactory} allows a safe connection to the Database.
*
* @author Bernd Heidemann
* @author Dominik Säume
* @version 1.0
*/
public class ConnectionBuilder {
@ -20,7 +21,7 @@ public class ConnectionBuilder {
private static Connection connection;
/**
* @return a Thread-safe {@link Connection} to the Database.
* @return A Thread-safe {@link Connection} to the Database.
*/
synchronized public static Connection getConnection() {
try {

View file

@ -5,44 +5,46 @@ import java.util.List;
/**
* {@link Dao} is the Abbreviation of Data-Access-Object.
* This Interface has the Basic Methods which are needed on any DAO to work as expected.
* This Interface has the Basic Methods which are needed on any {@link Dao} to work as expected.
*
* @param <T> The Model for which that DAO is implemented
* @param <T> The Model for which that {@link Dao} is implemented.
* @author Bernd Heidemann
* @author Dominik Säume
* @version 1.0
* @implSpec The Implementations should be added to the {@link DaoFactory}
* @implSpec The Implementations should be added to the {@link DaoFactory}.
*/
public interface Dao<T> {
/**
* Create a Database Entry from a Model object.
*
* @param t the Model instance
* @param t The Model instance.
*/
void create(T t) throws SQLException;
/**
* Read a Database Entry to a Model object.
*
* @param id of the Element in the Database
* @param id The ID of the Element in the Database.
*/
T read(int id) throws SQLException;
/**
* Read all Database Entries to a {@link List} of Model objects.
* @return All Database Entries as a {@link List} of Model instances
*/
List<T> readAll() throws SQLException;
/**
* Update the Database according to the Values of the Model object.
*
* @param t the Model instance.
* @param t The Model instance.
*/
void update(T t) throws SQLException;
/**
* Delete a Database Entry.
*
* @param id of the Element in the Database.
* @param id The ID of the Element in the Database.
*/
void delete(int id) throws SQLException;
}

View file

@ -6,9 +6,10 @@ import de.hitec.nhplus.patient.database.PatientDao;
import de.hitec.nhplus.treatment.database.TreatmentDao;
/**
* The {@link DaoFactory} is a Singleton({@link DaoFactory#getInstance}) which should be used to get {@link Dao}s.
* The {@link DaoFactory} is a Singleton({@link #getInstance}) which should be used to get {@link Dao}s.
*
* @author Bernd Heidemann
* @author Dominik Säume
* @version 1.0
*/
public class DaoFactory {
@ -22,7 +23,7 @@ public class DaoFactory {
}
/**
* @return {@link DaoFactory}, the Singleton Instance
* @return The Singleton Instance.
*/
public static DaoFactory getInstance() {
if (DaoFactory.instance == null) {
@ -32,28 +33,32 @@ public class DaoFactory {
}
/**
* @return a {@link TreatmentDao}
* @return A new {@link TreatmentDao} Instance with a Database Connection.
* @see de.hitec.nhplus.treatment.Treatment Treatment
*/
public TreatmentDao createTreatmentDao() {
return new TreatmentDao(ConnectionBuilder.getConnection());
}
/**
* @return a {@link PatientDao}
* @return A new {@link PatientDao} Instance with a Database Connection.
* @see de.hitec.nhplus.patient.Patient Patient
*/
public PatientDao createPatientDAO() {
return new PatientDao(ConnectionBuilder.getConnection());
}
/**
* @return a {@link NurseDao}
* @return A new {@link NurseDao} Instance with a Database Connection.
* @see de.hitec.nhplus.nurse.Nurse Nurse
*/
public NurseDao createNurseDAO() {
return new NurseDao(ConnectionBuilder.getConnection());
}
/**
* @return a {@link MedicationDao}
* @return A new {@link MedicationDao} Instance with a Database Connection.
* @see de.hitec.nhplus.medication.Medication Medication
*/
public MedicationDao createMedicationDAO() {
return new MedicationDao(ConnectionBuilder.getConnection());

View file

@ -10,16 +10,18 @@ import java.util.List;
* The {@link DaoImp} is a Generic Base Implementation of the {@link Dao},
* which should fit most use cases.
*
* @param <T> The Model for which that DAO is implemented
* @param <T> The Model for which that {@link Dao} is implemented.
* @author Bernd Heidemann
* @author Dominik Säume
* @version 1.0
* @implSpec The Implementations should be added to the {@link DaoFactory}
* @implSpec The Implementations should be added to the {@link DaoFactory}.
*/
public abstract class DaoImp<T> implements Dao<T> {
protected final Connection connection;
/**
* @param connection a Database Connection, which should be gotten from {@link ConnectionBuilder}
* @param connection The Database Connection to use
* @implSpec The Connection should be Received from the {@link ConnectionBuilder}.
*/
public DaoImp(Connection connection) {
this.connection = connection;
@ -28,7 +30,7 @@ public abstract class DaoImp<T> implements Dao<T> {
/**
* Creates a new Database Entry from a Model object.
*
* @param t the Model instance
* @param t The Model instance.
*/
@Override
public void create(T t) throws SQLException {
@ -38,7 +40,7 @@ public abstract class DaoImp<T> implements Dao<T> {
/**
* Read a Database Entry to a Model object.
*
* @param id of the Element in the Database
* @param id The ID of the Element in the Database.
*/
@Override
public T read(int id) throws SQLException {
@ -61,7 +63,7 @@ public abstract class DaoImp<T> implements Dao<T> {
/**
* Update the Database according to the Values of the Model object.
*
* @param t the Model instance.
* @param t The Model instance.
*/
@Override
public void update(T t) throws SQLException {
@ -71,7 +73,7 @@ public abstract class DaoImp<T> implements Dao<T> {
/**
* Delete a Database Entry.
*
* @param id of the Element in the Database.
* @param id The ID of the Element in the Database.
*/
@Override
public void delete(int id) throws SQLException {

View file

@ -1,12 +1,44 @@
package de.hitec.nhplus.fixtures;
import de.hitec.nhplus.datastorage.ConnectionBuilder;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;
public interface Fixture<T>
{
/**
* A Fixture is a Class, which can be used to set up a specific set of Data.
*
* @param <T> The Model for which the {@link Fixture} is implemented.
* @author Dominik Säume
* @version 1.0
* @implSpec The Implementations should be added to the {@link Fixtures#main}.
*/
public interface Fixture<T> {
/**
* Drop all Dependent Tables.
*
* @param connection A Database {@link Connection}, which should be received from
* the {@link ConnectionBuilder#getConnection}
* @implSpec Use {@code IF EXISTS}, to ensure that it doesn't throw an {@link Exception}.
*/
void dropTable(Connection connection) throws SQLException;
/**
* Set up the Empty Tables with the Schema.
*
* @param connection A Database {@link Connection}, which should be received from
* the {@link ConnectionBuilder#getConnection}
*/
void setupTable(Connection connection) throws SQLException;
/**
* Loads all Model specific Data to the Database.
*
* @return A Map of Models with a {@link String} key, to be used by other {@link Fixture}
* @implSpec The {@link de.hitec.nhplus.datastorage.Dao Dao} should be received
* from {@link de.hitec.nhplus.datastorage.DaoFactory DaoFactory}.
*/
Map<String, T> load() throws SQLException;
}

View file

@ -6,14 +6,23 @@ import de.hitec.nhplus.patient.Patient;
import java.sql.Connection;
import java.util.Map;
public class Fixtures
{
public static void main(String[] args)
{
/**
* A Class, Implementing an Entrypoint({@link #main}), for loading a Specific set of Data.
*
* @author Dominik Säume
* @version 1.0
*/
public class Fixtures {
/**
* An Entrypoint, for loading a Specific set of Data.
*
* @param args unused.
*/
public static void main(String[] args) {
Connection connection = ConnectionBuilder.getConnection();
try
{
try {
PatientFixture patientFixture = new PatientFixture();
patientFixture.dropTable(connection);
patientFixture.setupTable(connection);