Skip to content
Snippets Groups Projects
Commit 643b5583 authored by Thiemo Belmega's avatar Thiemo Belmega
Browse files

Adjust SQL statements to altered database schema

parent 05671b21
No related branches found
No related tags found
No related merge requests found
......@@ -38,7 +38,12 @@ public class SqlStatementFactory {
}
public PreparedStatement getInsertInto(String tableName) throws SQLException {
return getCustomizedStatement("insertBO", tableName);
switch (tableName) {
case "category":
return getCustomizedStatement("insertCategory", tableName);
default:
return getCustomizedStatement("insertBO", tableName);
}
}
......
......@@ -4,6 +4,7 @@
<entry key="selectBO">SELECT * FROM TABLE_NAME WHERE uuid = ?;</entry>
<entry key="selectAll">SELECT * FROM TABLE_NAME;</entry>
<entry key="insertBO">INSERT INTO TABLE_NAME VALUES (?,?,?);</entry>
<entry key="insertCategory">INSERT INTO TABLE_NAME VALUES (?,?,?,NULL);</entry>
<entry key="updateBO">UPDATE TABLE_NAME SET title = ?, description = ? WHERE uuid = ?;</entry>
<entry key="deleteBO">DELETE FROM TABLE_NAME WHERE uuid = ?;</entry>
<entry key="selectRelation">SELECT * FROM TABLE_NAME WHERE FOREIGN_KEY = ?;</entry>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment