1 package mircoders.storage;
8 import freemarker.template.*;
15 * <b>Diese Klasse implementiert die Datenbankverbindung zur MetaObjekt-Tabelle
20 public class DatabaseMedia extends Database implements StorageObject{
22 private static DatabaseMedia instance;
23 private static EntityRelation relationMediaType;
25 public static DatabaseMedia getInstance() throws StorageObjectException {
26 if (instance == null) {
27 instance = new DatabaseMedia();
28 instance.myselfDatabase = instance;
33 private DatabaseMedia() throws StorageObjectException
36 this.cache = new HashMap();
37 this.hasTimestamp = false;
38 this.theTable="media*";
39 relationMediaType = new EntityRelation("to_media_type", "id", DatabaseMediaType.getInstance(), EntityRelation.TO_ONE);
41 this.theEntityClass = Class.forName("mircoders.entity.EntityMedia");
44 throw new StorageObjectException(e.toString());
52 * returns the comments that belong to the article (via entityrelation)
53 * where db-flag is_published is true
55 public Entity getMediaType(Entity ent) {
58 type = relationMediaType.getOne(ent);
60 catch (StorageObjectException e) {
61 theLog.printError("DatabaseUploadedMedia :: failed to get media_type");