changed the behaviour of entity uploaded media so that articles/comments linking...
[mir.git] / source / mircoders / entity / EntityUploadedMedia.java
index 74cb05c..b28cdb1 100755 (executable)
  */
 package mircoders.entity;
 
-import java.sql.SQLException;
-import java.util.Map;
-
 import mir.entity.AbstractEntity;
 import mir.entity.Entity;
-import mir.log.LoggerWrapper;
 import mir.storage.DatabaseFailure;
 import mircoders.storage.DatabaseUploadedMedia;
 
+import java.util.Map;
+
 /**
  *
  * @author mh, mir-coders group
- * @version $Id: EntityUploadedMedia.java,v 1.26.2.12 2005/03/26 11:26:26 zapata Exp $
+ * @version $Id: EntityUploadedMedia.java,v 1.26.2.15 2006/02/21 20:24:43 zapata Exp $
  */
 
 public class EntityUploadedMedia extends AbstractEntity {
-  public EntityUploadedMedia() {
-    super();
-
-    logger = new LoggerWrapper("Entity.UploadedMedia");
-  }
-
-  public void update() throws DatabaseFailure {
-    super.update();
-
-    try {
-      database.executeUpdate(
-          "update content " +
-          "set is_produced='0' " +
-          "from content_x_media cxm " +
-          "where" +
-          "   cxm.content_id=content.id and cxm.media_id=" + getId()
-      );
-
-      database.executeUpdate(
-          "update content " +
-          "set is_produced='0' " +
-          "from comment_x_media cxm, comment c "+
-          "where " +
-          "   cxm.comment_id = c.id and " +
-          "   c.to_media=content.id and " +
-          "   cxm.media_id=" + getId()
-      );
-    }
-    catch (SQLException e) {
-      throw new DatabaseFailure(e);
-    }
-  }
-
   public void setFieldValues(Map theStringValues) {
     if (theStringValues != null) {
       if (!theStringValues.containsKey("is_published"))