Database script continue + tests Junit5 #4

This commit is contained in:
JunkJumper
2020-04-29 19:14:18 +02:00
parent feee1885bd
commit 641d298bd3
4 changed files with 60 additions and 1 deletions

View File

@ -18,4 +18,13 @@ public class QueryGenerator {
return "public." + '"' + s + '"';
}
public static String getIdWithNameFrom(String table, String name) {
return "SELECT 'id' FROM " + getTable(table) + "WHERE nom ='" + name + "'";
}
public static String getNameWithIdFrom(String table, int d) {
return "SELECT name FROM " + getTable(table) + "WHERE id =" + d;
}
}

View File

@ -39,6 +39,5 @@ public class Record {
public String toString() {
return String.format("%-20.30s %-30.30s %-20.30s%n", this.getId(), this.getNom(), this.getImg());
}
}

View File

@ -84,6 +84,14 @@ public class Table {
return " " + this.getList();
}
public boolean isEmpty() {
if(list.isEmpty()) {
return true;
} else {
return false;
}
}