summaryrefslogtreecommitdiff
path: root/sql-persistence/src/main/java/io/trygvis/persistence/sql/SqlDao.java
diff options
context:
space:
mode:
Diffstat (limited to 'sql-persistence/src/main/java/io/trygvis/persistence/sql/SqlDao.java')
-rw-r--r--sql-persistence/src/main/java/io/trygvis/persistence/sql/SqlDao.java25
1 files changed, 25 insertions, 0 deletions
diff --git a/sql-persistence/src/main/java/io/trygvis/persistence/sql/SqlDao.java b/sql-persistence/src/main/java/io/trygvis/persistence/sql/SqlDao.java
new file mode 100644
index 0000000..7df3658
--- /dev/null
+++ b/sql-persistence/src/main/java/io/trygvis/persistence/sql/SqlDao.java
@@ -0,0 +1,25 @@
+package io.trygvis.persistence.sql;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+public abstract class SqlDao<Id, T> implements FromResultSet<T> {
+
+ protected final Connection c;
+
+ protected SqlDao(Connection c) {
+ this.c = c;
+ }
+
+ public abstract void insert(T o) throws SQLException;
+
+ public abstract void delete(T o) throws SQLException;
+
+ public abstract void deleteById(Id id) throws SQLException;
+
+// public abstract TypedQuery<T> query();
+
+ public abstract T selectById(Id id) throws SQLException;
+
+ public abstract void update(T entity) throws SQLException;
+}