fixed / clean ups
[mir.git] / source / mircoders / entity / EntityUploadedMedia.java
index 8c38e50..436cdb0 100755 (executable)
 package mircoders.entity;
 
 import java.sql.SQLException;
-import java.util.List;
 import java.util.Map;
 
+import mir.entity.AbstractEntity;
 import mir.entity.Entity;
 import mir.log.LoggerWrapper;
-import mircoders.media.MediaHelper;
-import mir.media.MediaHandler;
-import mir.misc.NumberUtils;
 import mir.storage.StorageObject;
 import mir.storage.StorageObjectFailure;
 import mircoders.storage.DatabaseUploadedMedia;
@@ -45,11 +42,10 @@ import mircoders.storage.DatabaseUploadedMedia;
 /**
  *
  * @author mh, mir-coders group
- * @version $Id: EntityUploadedMedia.java,v 1.26.2.5 2003/12/21 13:32:04 zapata Exp $
+ * @version $Id: EntityUploadedMedia.java,v 1.26.2.6 2004/01/18 17:30:58 zapata Exp $
  */
 
-
-public class EntityUploadedMedia extends Entity {
+public class EntityUploadedMedia extends AbstractEntity {
   public EntityUploadedMedia() {
     super();
 
@@ -66,11 +62,11 @@ public class EntityUploadedMedia extends Entity {
     super.update();
 
     try {
-      theStorageObject.executeUpdate( "update content set is_produced='0' where exists(select * from content_x_media where content_id=content.id and media_id=" + getId()+")");
-      theStorageObject.executeUpdate( "update content set is_produced='0' where exists(select * from comment_x_media, comment where comment_x_media.comment_id=comment.id and comment.to_media=content.id and comment_x_media.media_id=" + getId()+")");
+      storageObject.executeUpdate( "update content set is_produced='0' where exists(select * from content_x_media where content_id=content.id and media_id=" + getId()+")");
+      storageObject.executeUpdate( "update content set is_produced='0' where exists(select * from comment_x_media, comment where comment_x_media.comment_id=comment.id and comment.to_media=content.id and comment_x_media.media_id=" + getId()+")");
     }
     catch (SQLException e) {
-      throwStorageObjectFailure(e, "EntityUploadedMedia :: update :: failed!! ");
+      throw new StorageObjectFailure(e);
     }
   }
 
@@ -94,7 +90,7 @@ public class EntityUploadedMedia extends Entity {
       ent = DatabaseUploadedMedia.getInstance().getMediaType(this);
     }
     catch (StorageObjectFailure e) {
-      throwStorageObjectFailure(e, "get MediaType failed -- ");
+      throw new StorageObjectFailure(e);
     }
     return ent;
   }