summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
diff options
context:
space:
mode:
authorSimon Rettberg2015-09-09 15:14:43 +0200
committerSimon Rettberg2015-09-09 15:14:43 +0200
commit864297f4ae1530da3a4d7a903782b6e34071b424 (patch)
tree1296c12fe2f9a0dc8e2b3cfefaa65870df9c5fd4 /dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
parent[server] Also inform lecture owners about expising images, if the image expir... (diff)
downloadtutor-module-864297f4ae1530da3a4d7a903782b6e34071b424.tar.gz
tutor-module-864297f4ae1530da3a4d7a903782b6e34071b424.tar.xz
tutor-module-864297f4ae1530da3a4d7a903782b6e34071b424.zip
[server] Fix virtualizer store query
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
index df34b97a..f82efe24 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/database/mappers/DbLecture.java
@@ -487,4 +487,22 @@ public class DbLecture {
}
}
+ public static List<LectureSummary> getLecturesUsingImageVersion(String imageVersionId) throws SQLException {
+ try (MysqlConnection connection = Database.getConnection()) {
+ MysqlStatement stmt = connection.prepareStatement(summaryBaseSql
+ + " WHERE l.imageversionid = :imageversionid");
+ stmt.setString("userid", "-");
+ stmt.setString("imageversionid", imageVersionId);
+ ResultSet rs = stmt.executeQuery();
+ List<LectureSummary> list = new ArrayList<>();
+ while (rs.next()) {
+ list.add(fillSummary(null, rs));
+ }
+ return list;
+ } catch (SQLException e) {
+ LOGGER.error("Query failed in DbLecture.getExpiringLectures()", e);
+ throw e;
+ }
+ }
+
}