1 package mircoders.storage;
8 import freemarker.template.*;
15 * <b>This class implements the access to the media_type-table for the
21 public class DatabaseMediaType extends Database implements StorageObject{
23 private static DatabaseMediaType instance;
25 // the following *has* to be sychronized cause this static method
26 // could get preemted and we could end up with 2 instances of DatabaseFoo..
27 // see the "Singletons with needles and thread" article at JavaWorld -mh
28 public synchronized static DatabaseMediaType getInstance()
29 throws StorageObjectException {
30 if (instance == null) {
31 instance = new DatabaseMediaType();
32 instance.myselfDatabase = instance;
37 private DatabaseMediaType() throws StorageObjectException
40 this.hasTimestamp = false;
41 //this.cache = new DatabaseCache(20);
42 this.theTable="media_type";
44 this.theEntityClass = Class.forName("mir.entity.GenericEntity");
46 catch (Exception e) { throw new StorageObjectException(e.toString()); }