first cut of merge of STABLE-pre1_0 into HEAD. I won't even guarantee that it
[mir.git] / source / mircoders / storage / DatabaseMedia.java
index 3094f76..de0e294 100755 (executable)
@@ -33,10 +33,11 @@ public class DatabaseMedia extends Database implements StorageObject{
   private DatabaseMedia() throws StorageObjectException
   {
     super();
-    this.cache = new HashMap();
+    //this.cache = new DatabaseCache(100);
     this.hasTimestamp = false;
-    this.theTable="media*";
-    relationMediaType = new EntityRelation("to_media_type", "id", DatabaseMediaType.getInstance(), EntityRelation.TO_ONE);
+    this.theTable="media";
+    relationMediaType = new EntityRelation("to_media_type", "id", 
+                        DatabaseMediaType.getInstance(), EntityRelation.TO_ONE);
     try {
       this.theEntityClass = Class.forName("mircoders.entity.EntityMedia");
     }
@@ -52,13 +53,14 @@ public class DatabaseMedia extends Database implements StorageObject{
    * returns the comments that belong to the article (via entityrelation)
    * where db-flag is_published is true
    */
-  public Entity getMediaType(Entity ent) {
+  public Entity getMediaType(Entity ent) throws StorageObjectException {
     Entity type=null;
     try {
       type = relationMediaType.getOne(ent);
     }
     catch (StorageObjectException e) {
-      theLog.printError("DatabaseUploadedMedia :: failed to get media_type");
+      theLog.printError("DatabaseMedia :: failed to get media_type");
+      throw new StorageObjectException("DatabaseMedia :"+e.toString());
     }
     return type;
   }