4368007c1e20ddf471380ea300461f7391110832
[mir.git] / source / mircoders / storage / DatabaseFeature.java
1 package mircoders.storage;
2
3 import java.lang.*;
4 import java.sql.*;
5 import java.io.*;
6 import java.util.*;
7
8 import freemarker.template.*;
9
10 import mir.storage.*;
11 import mir.entity.*;
12 import mir.misc.*;
13
14 /**
15  * <b>Diese Klasse implementiert die Datenbankverbindung zur MetaObjekt-Tabelle
16  *
17  *
18  */
19
20 public class DatabaseFeature extends Database implements StorageObject{
21
22   private static DatabaseFeature instance;
23
24   // the following *has* to be sychronized cause this static method
25   // could get preemted and we could end up with 2 instances of DatabaseFoo..
26   // see the "Singletons with needles and thread" article at JavaWorld -mh
27   public synchronized static DatabaseFeature getInstance() 
28     throws StorageObjectException {
29       if (instance == null) {
30     instance = new DatabaseFeature();
31     instance.myselfDatabase = instance;
32       }
33     return instance;
34   }
35
36   private DatabaseFeature() throws StorageObjectException
37   {
38     super();
39     //this.cache = new DatabaseCache(10);
40     this.hasTimestamp = false;
41     this.theTable="feature";
42
43     try {
44         this.theEntityClass = Class.forName("mircoders.entity.EntityFeature");
45     }
46     catch (Exception e) {
47         throw new StorageObjectException(e.toString());
48     }
49   }
50
51   public SimpleList getPopupData() throws StorageObjectException {
52     return getPopupData("title",true);
53   }
54
55 }