Get maker reagent from PG db, rework processor (no statics)

This commit is contained in:
P0nk
2023-03-02 08:18:03 +01:00
parent 5cecb7adb6
commit c0c0a2d2d9
11 changed files with 155 additions and 80 deletions

View File

@@ -1,5 +1,6 @@
package database;
import database.maker.MakerReagentRowMapper;
import database.note.NoteRowMapper;
import org.jdbi.v3.core.Handle;
import org.jdbi.v3.core.Jdbi;
@@ -14,8 +15,14 @@ public class PgDatabaseConnection {
public PgDatabaseConnection(DataSource dataSource) {
this.dataSource = dataSource;
this.jdbi = Jdbi.create(dataSource)
.registerRowMapper(new NoteRowMapper()); // TODO: configure jdbi elsewhere
this.jdbi = Jdbi.create(dataSource);
registerRowMappers();
// TODO: configure jdbi elsewhere
}
private void registerRowMappers() {
jdbi.registerRowMapper(new NoteRowMapper())
.registerRowMapper(new MakerReagentRowMapper());
}
public Connection getConnection() throws SQLException {