Database script continue + tests Junit5 #4
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -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());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -84,6 +84,14 @@ public class Table {
|
||||
return " " + this.getList();
|
||||
}
|
||||
|
||||
public boolean isEmpty() {
|
||||
if(list.isEmpty()) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user