NOTICKET: Fix Javadoc Generation
Signed-off-by: Dominik Säume <Dominik.Saeume@hmmh.de>
This commit is contained in:
parent
f5dc9c3343
commit
85cfe4fff9
7 changed files with 94 additions and 34 deletions
15
pom.xml
15
pom.xml
|
@ -21,12 +21,12 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openjfx</groupId>
|
<groupId>org.openjfx</groupId>
|
||||||
<artifactId>javafx-controls</artifactId>
|
<artifactId>javafx-controls</artifactId>
|
||||||
<version>20.0.1</version>
|
<version>21.0.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.openjfx</groupId>
|
<groupId>org.openjfx</groupId>
|
||||||
<artifactId>javafx-fxml</artifactId>
|
<artifactId>javafx-fxml</artifactId>
|
||||||
<version>20.0.1</version>
|
<version>21.0.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.controlsfx</groupId>
|
<groupId>org.controlsfx</groupId>
|
||||||
|
@ -112,11 +112,20 @@
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-javadoc-plugin</artifactId>
|
<artifactId>maven-javadoc-plugin</artifactId>
|
||||||
<version>3.6.0</version>
|
<version>3.6.3</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
|
<source>21</source>
|
||||||
|
<release>21</release>
|
||||||
|
<author>true</author>
|
||||||
|
<doclint>all,-missing</doclint>
|
||||||
<reportOutputDirectory>${project.basedir}</reportOutputDirectory>
|
<reportOutputDirectory>${project.basedir}</reportOutputDirectory>
|
||||||
<sourcepath>src/main/java</sourcepath>
|
<sourcepath>src/main/java</sourcepath>
|
||||||
<destDir>javadoc_build</destDir>
|
<destDir>javadoc_build</destDir>
|
||||||
|
<tags>
|
||||||
|
<tag>
|
||||||
|
<name>implSpec</name>
|
||||||
|
</tag>
|
||||||
|
</tags>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
|
@ -10,6 +10,7 @@ import java.sql.SQLException;
|
||||||
* The {@link DaoFactory} allows a safe connection to the Database.
|
* The {@link DaoFactory} allows a safe connection to the Database.
|
||||||
*
|
*
|
||||||
* @author Bernd Heidemann
|
* @author Bernd Heidemann
|
||||||
|
* @author Dominik Säume
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class ConnectionBuilder {
|
public class ConnectionBuilder {
|
||||||
|
@ -20,7 +21,7 @@ public class ConnectionBuilder {
|
||||||
private static Connection connection;
|
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() {
|
synchronized public static Connection getConnection() {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -5,44 +5,46 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link Dao} is the Abbreviation of Data-Access-Object.
|
* {@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 Bernd Heidemann
|
||||||
|
* @author Dominik Säume
|
||||||
* @version 1.0
|
* @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> {
|
public interface Dao<T> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a Database Entry from a Model object.
|
* Create a Database Entry from a Model object.
|
||||||
*
|
*
|
||||||
* @param t the Model instance
|
* @param t The Model instance.
|
||||||
*/
|
*/
|
||||||
void create(T t) throws SQLException;
|
void create(T t) throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Read a Database Entry to a Model object.
|
* 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;
|
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;
|
List<T> readAll() throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update the Database according to the Values of the Model object.
|
* 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;
|
void update(T t) throws SQLException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Delete a Database Entry.
|
* 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;
|
void delete(int id) throws SQLException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,10 @@ import de.hitec.nhplus.patient.database.PatientDao;
|
||||||
import de.hitec.nhplus.treatment.database.TreatmentDao;
|
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 Bernd Heidemann
|
||||||
|
* @author Dominik Säume
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
*/
|
*/
|
||||||
public class DaoFactory {
|
public class DaoFactory {
|
||||||
|
@ -22,7 +23,7 @@ public class DaoFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@link DaoFactory}, the Singleton Instance
|
* @return The Singleton Instance.
|
||||||
*/
|
*/
|
||||||
public static DaoFactory getInstance() {
|
public static DaoFactory getInstance() {
|
||||||
if (DaoFactory.instance == null) {
|
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() {
|
public TreatmentDao createTreatmentDao() {
|
||||||
return new TreatmentDao(ConnectionBuilder.getConnection());
|
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() {
|
public PatientDao createPatientDAO() {
|
||||||
return new PatientDao(ConnectionBuilder.getConnection());
|
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() {
|
public NurseDao createNurseDAO() {
|
||||||
return new NurseDao(ConnectionBuilder.getConnection());
|
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() {
|
public MedicationDao createMedicationDAO() {
|
||||||
return new MedicationDao(ConnectionBuilder.getConnection());
|
return new MedicationDao(ConnectionBuilder.getConnection());
|
||||||
|
|
|
@ -10,16 +10,18 @@ import java.util.List;
|
||||||
* The {@link DaoImp} is a Generic Base Implementation of the {@link Dao},
|
* The {@link DaoImp} is a Generic Base Implementation of the {@link Dao},
|
||||||
* which should fit most use cases.
|
* 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 Bernd Heidemann
|
||||||
|
* @author Dominik Säume
|
||||||
* @version 1.0
|
* @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> {
|
public abstract class DaoImp<T> implements Dao<T> {
|
||||||
protected final Connection connection;
|
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) {
|
public DaoImp(Connection connection) {
|
||||||
this.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.
|
* Creates a new Database Entry from a Model object.
|
||||||
*
|
*
|
||||||
* @param t the Model instance
|
* @param t The Model instance.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void create(T t) throws SQLException {
|
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.
|
* 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
|
@Override
|
||||||
public T read(int id) throws SQLException {
|
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.
|
* Update the Database according to the Values of the Model object.
|
||||||
*
|
*
|
||||||
* @param t the Model instance.
|
* @param t The Model instance.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void update(T t) throws SQLException {
|
public void update(T t) throws SQLException {
|
||||||
|
@ -71,7 +73,7 @@ public abstract class DaoImp<T> implements Dao<T> {
|
||||||
/**
|
/**
|
||||||
* Delete a Database Entry.
|
* Delete a Database Entry.
|
||||||
*
|
*
|
||||||
* @param id of the Element in the Database.
|
* @param id The ID of the Element in the Database.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void delete(int id) throws SQLException {
|
public void delete(int id) throws SQLException {
|
||||||
|
|
|
@ -1,12 +1,44 @@
|
||||||
package de.hitec.nhplus.fixtures;
|
package de.hitec.nhplus.fixtures;
|
||||||
|
|
||||||
|
import de.hitec.nhplus.datastorage.ConnectionBuilder;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Map;
|
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;
|
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;
|
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;
|
Map<String, T> load() throws SQLException;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,14 +6,23 @@ import de.hitec.nhplus.patient.Patient;
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
public class Fixtures
|
/**
|
||||||
{
|
* A Class, Implementing an Entrypoint({@link #main}), for loading a Specific set of Data.
|
||||||
public static void main(String[] args)
|
*
|
||||||
{
|
* @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();
|
Connection connection = ConnectionBuilder.getConnection();
|
||||||
|
|
||||||
try
|
try {
|
||||||
{
|
|
||||||
PatientFixture patientFixture = new PatientFixture();
|
PatientFixture patientFixture = new PatientFixture();
|
||||||
patientFixture.dropTable(connection);
|
patientFixture.dropTable(connection);
|
||||||
patientFixture.setupTable(connection);
|
patientFixture.setupTable(connection);
|
||||||
|
|
Loading…
Reference in a new issue