From d12670ce84bd74feeb82e3d9c7a3f9a944bfed9e Mon Sep 17 00:00:00 2001 From: Björn Hagemeister Date: Wed, 22 Oct 2014 16:37:32 +0200 Subject: Fixed several things for successful up and download of images after using all arguments of database. --- src/main/java/org/openslx/satellitedaemon/db/DbImage.java | 15 +++++++++++++-- src/main/java/org/openslx/satellitedaemon/db/DbUser.java | 4 ++-- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src/main/java/org/openslx/satellitedaemon/db') diff --git a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java index e34a2ca..c35fd5d 100644 --- a/src/main/java/org/openslx/satellitedaemon/db/DbImage.java +++ b/src/main/java/org/openslx/satellitedaemon/db/DbImage.java @@ -35,6 +35,17 @@ public class DbImage rid = -1; if ( fileSize == null ) fileSize = (long) -1; + if (createTime == null) + createTime = (long) 0; + if (changeTime == null) + changeTime = (long) 0; + if (contentOperatingSystem == null) + contentOperatingSystem = 0; + if (isValid == null) + isValid = true; + if (isDeleted == null) + isDeleted = false; + this.guid = guid; this.name = name; this.rid = rid; @@ -44,8 +55,8 @@ public class DbImage this.createTime = createTime; this.changeTime = changeTime; this.contentOperatingSystem = contentOperatingSystem; - this.isValid = isValid; - this.isDeleted = isDeleted; + this.isValid = true; + this.isDeleted = false; } /** diff --git a/src/main/java/org/openslx/satellitedaemon/db/DbUser.java b/src/main/java/org/openslx/satellitedaemon/db/DbUser.java index deebd66..3aa57d2 100644 --- a/src/main/java/org/openslx/satellitedaemon/db/DbUser.java +++ b/src/main/java/org/openslx/satellitedaemon/db/DbUser.java @@ -24,8 +24,8 @@ public class DbUser */ public static DbUser getUserById(String userId) { return MySQL.findUniqueOrNull( DbUser.class, "SELECT user.userID, user.Vorname AS firstName, " + - "user.Nachname AS lastName, user.mail AS email, user.institution" + - "FROM m_user user" + + "user.Nachname AS lastName, user.mail AS email, user.institution " + + "FROM m_user user " + "WHERE userID = ?", userId ); } } -- cgit v1.2.3-55-g7522