added cache in EntityContent for comments, media, etc.. this cache must
[mir.git] / source / mircoders / storage / DatabaseContentToMedia.java
index 1015e6c..1569bb4 100755 (executable)
@@ -63,6 +63,28 @@ public class DatabaseContentToMedia extends Database implements StorageObject{
     return returnList;
   }
 
+  public boolean hasMedia(EntityContent content)
+    throws StorageObjectException {
+    String wc = "content_id="+content.getId();
+    if( content != null) {
+      try {
+        if(selectByWhereClause(wc,-1).size() == 0)
+          return false;
+        else
+          return true;
+      } catch (Exception e) {
+        theLog.printError("-- hasMedia failed " + e.toString());
+        throw new StorageObjectException("-- hasMedia failed " + e.toString());
+      }
+    } else {
+      theLog.printError("-- hasMedia failed: content is NULL");
+      throw new StorageObjectException("-- hasMedia failed: content is NULL");
+    }
+  }
+      
+
+
+
   /**
    * get all the audio belonging to a content entity
    *