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");
}
* 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;
}