2e1210ea6a5cc5d0937a4364cb407a88b4c22217
[mir.git] / source / mircoders / storage / DatabaseTopics.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 DatabaseTopics extends Database implements StorageObject{
21
22   private static DatabaseTopics 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 DatabaseTopics getInstance() 
28     throws StorageObjectException {
29       if (instance == null) {
30     instance = new DatabaseTopics();
31     instance.myselfDatabase = instance;
32       }
33     return instance;
34   }
35
36   private DatabaseTopics() throws StorageObjectException
37   {
38           super();
39       //this.cache = new DatabaseCache(20);
40       this.hasTimestamp = false;
41       this.theTable="topic";
42       try {
43     this.theEntityClass = Class.forName("mircoders.entity.EntityTopics");
44       }
45       catch (Exception e) {
46     throw new StorageObjectException(e.toString());
47       }
48
49   }
50
51   public SimpleList getPopupData() throws StorageObjectException {
52     return getPopupData("title",true);
53   }
54
55
56
57 }