src/main/java/de/uapcore/lightpit/dao/AbstractDao.java

changeset 40
276ef00a336d
parent 39
e722861558bb
--- a/src/main/java/de/uapcore/lightpit/dao/AbstractDao.java	Tue May 12 22:03:00 2020 +0200
+++ b/src/main/java/de/uapcore/lightpit/dao/AbstractDao.java	Wed May 13 18:31:52 2020 +0200
@@ -74,7 +74,7 @@
         }
     }
 
-    protected final void setForeignKeyOrNull(PreparedStatement stmt, int index, Object instance, Function<Object, Integer> keyGetter) throws SQLException {
+    protected final <T> void setForeignKeyOrNull(PreparedStatement stmt, int index, T instance, Function<? super T, Integer> keyGetter) throws SQLException {
         Integer key = Optional.ofNullable(instance).map(keyGetter).orElse(null);
         if (key == null) {
             stmt.setNull(index, Types.INTEGER);

mercurial