fixing scaling images -> nullpointer, patch by yossarian
[mir.git] / source / mircoders / storage / DatabaseVideo.java
index 7bcdaef..eaff7e4 100755 (executable)
@@ -36,17 +36,7 @@ import mir.entity.Entity;
 import mir.log.LoggerWrapper;
 import mir.misc.StringUtil;
 import mir.storage.Database;
-import mir.storage.StorageObjectFailure;
-
-/**
- *
- * <p>Title: </p>
- * <p>Description: </p>
- * <p>Copyright: Copyright (c) 2003</p>
- * <p>Company: </p>
- * @author not attributable
- * @version 1.0
- */
+import mir.storage.DatabaseFailure;
 
 public class DatabaseVideo extends Database {
 
@@ -67,11 +57,10 @@ public class DatabaseVideo extends Database {
 
     logger = new LoggerWrapper("Database.Video");
     mainTable = "video";
-    primaryKeySequence = "media_id_seq";
     entityClass = mircoders.entity.EntityVideo.class;
   }
 
-  public void update(Entity theEntity) throws StorageObjectFailure {
+  public void update(Entity theEntity) throws DatabaseFailure {
     String date = theEntity.getFieldValue("date");
     if (date == null) {
       date = StringUtil.date2webdbDate(new GregorianCalendar());
@@ -81,7 +70,7 @@ public class DatabaseVideo extends Database {
     super.update(theEntity);
   }
 
-  public String insert(Entity theEntity) throws StorageObjectFailure {
+  public String insert(Entity theEntity) throws DatabaseFailure {
     String date = theEntity.getFieldValue("date");
     if (date == null) {
       date = StringUtil.date2webdbDate(new GregorianCalendar());
@@ -90,4 +79,7 @@ public class DatabaseVideo extends Database {
     return super.insert(theEntity);
   }
 
+  protected String getPrimaryKeySequence() {
+    return "media_id_seq";
+  }
 }