diff --git a/src/main/java/a_enterprise_business_rules/entities/Task.java b/src/main/java/a_enterprise_business_rules/entities/Task.java index 52c26df..d99d2f7 100644 --- a/src/main/java/a_enterprise_business_rules/entities/Task.java +++ b/src/main/java/a_enterprise_business_rules/entities/Task.java @@ -199,6 +199,12 @@ public boolean equals(Object o) { return allAttributesAreEqual; } + /** + * + * @param taskID + * @param listOfTasks + * @return + */ public static Task IDToTask(UUID taskID, ArrayList listOfTasks) { int i = 0; boolean taskFound = false; @@ -213,4 +219,6 @@ public static Task IDToTask(UUID taskID, ArrayList listOfTasks) { } return task; } + + } \ No newline at end of file diff --git a/src/main/java/b_application_business_rules/use_cases/project_selection_gateways/IEntityIDsToList.java b/src/main/java/b_application_business_rules/use_cases/project_selection_gateways/IEntityIDsToList.java index de18d5d..da66e38 100644 --- a/src/main/java/b_application_business_rules/use_cases/project_selection_gateways/IEntityIDsToList.java +++ b/src/main/java/b_application_business_rules/use_cases/project_selection_gateways/IEntityIDsToList.java @@ -1,8 +1,13 @@ package b_application_business_rules.use_cases.project_selection_gateways; -import a_enterprise_business_rules.entities.*; import b_application_business_rules.entity_models.*; public interface IEntityIDsToList { + /** + * This returns a concatenated string of column IDs of the given model. + */ String EntityIDsToList(ProjectModel projectModel); + /** + * This returns a concatenated string of Task IDs of the given column model. + */ String EntityIDsToList(ColumnModel columnModel); } diff --git a/src/main/java/d_frameworks_and_drivers/database_management/DBControllers/EntityIDstoModelController.java b/src/main/java/d_frameworks_and_drivers/database_management/DBControllers/EntityIDstoModelController.java index c92d991..51ca405 100644 --- a/src/main/java/d_frameworks_and_drivers/database_management/DBControllers/EntityIDstoModelController.java +++ b/src/main/java/d_frameworks_and_drivers/database_management/DBControllers/EntityIDstoModelController.java @@ -1,11 +1,13 @@ package d_frameworks_and_drivers.database_management.DBControllers; import b_application_business_rules.entity_models.ColumnModel; -import b_application_business_rules.entity_models.*; +import b_application_business_rules.entity_models.ProjectModel; import b_application_business_rules.entity_models.TaskModel; + import b_application_business_rules.factories.ColumnModelFactory; import b_application_business_rules.factories.ProjectModelFactory; import b_application_business_rules.factories.TaskModelFactory; + import d_frameworks_and_drivers.database_management.ProjectUUIDArray; import c_interface_adapters.DBAdapterInterface; diff --git a/src/main/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv b/src/main/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv index fdb6079..d15c307 100644 --- a/src/main/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv +++ b/src/main/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv @@ -1,2 +1 @@ "UUID","State" -"xkfnfk","true" \ No newline at end of file diff --git a/src/main/java/d_frameworks_and_drivers/database_management/UUIDsToHashMap/UUIDMap.java b/src/main/java/d_frameworks_and_drivers/database_management/UUIDsToHashMap/UUIDMap.java index f936291..dcb1b72 100644 --- a/src/main/java/d_frameworks_and_drivers/database_management/UUIDsToHashMap/UUIDMap.java +++ b/src/main/java/d_frameworks_and_drivers/database_management/UUIDsToHashMap/UUIDMap.java @@ -10,7 +10,6 @@ public class UUIDMap { /** - * * @return */ public static Map convertCsvToHashMap() { @@ -36,6 +35,7 @@ public static Map convertCsvToHashMap() { return csvDataMap; } +} // Old version // public static void main(String[] args) { // String csvFilePath = "DatabaseFiles/UniqueIDs/UniqueIDs.csv"; // Replace with the path to your CSV file @@ -50,4 +50,4 @@ public static Map convertCsvToHashMap() { // e.printStackTrace(); // } // } -} + diff --git a/src/main/java/d_frameworks_and_drivers/database_management/csv_database_documentation b/src/main/java/d_frameworks_and_drivers/database_management/csv_database_documentation new file mode 100644 index 0000000..fa10aea --- /dev/null +++ b/src/main/java/d_frameworks_and_drivers/database_management/csv_database_documentation @@ -0,0 +1,27 @@ +# General + +## try-with-resources +When using try-with-resources e.g. + (FileWriter outputfile = new FileWriter("DatabaseFiles/Columns/Columns.csv"); + CSVPrinter csvPrinter = new CSVPrinter(outputfile, CSVFormat.DEFAULT.withHeader())) +- make sure objects are AutoCloseable; they will close automatically after try block ends + +# org.apache.commons.csv.CSVFormat; + +## DEFAULT format: + only non-empty rows/records are processed. + Windows record/row separator used ("\r\n") -> potential errors in Unix-based systems ? + processes duplicate csv headers without errors -> avoid duplicates in headers + "" quotes enclose field values (in a single cell) + , delimeter separates fields + +## withHeader() +- use only if csv files have first row with headers already + +# org.apache.commons.csv.CSVParser; + +## + +# org.apache.commons.csv.CSVRecord; + +## \ No newline at end of file diff --git a/src/test/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv b/src/test/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv index fdb6079..d15c307 100644 --- a/src/test/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv +++ b/src/test/java/d_frameworks_and_drivers/database_management/DatabaseFiles/UniqueIDs/UniqueIDs.csv @@ -1,2 +1 @@ "UUID","State" -"xkfnfk","true" \ No newline at end of file