1 package mircoders.storage;
8 import freemarker.template.*;
10 import webdb.storage.*;
11 import webdb.entity.*;
15 * <b>This class implements the access to the comment-table for the
21 public class DatabaseComment extends Database implements StorageObject{
23 private static DatabaseComment instance;
25 public static DatabaseComment getInstance() throws StorageObjectException {
26 if (instance == null) {
27 instance = new DatabaseComment();
28 instance.myselfDatabase = instance;
33 private DatabaseComment() throws StorageObjectException
36 this.hasTimestamp = false;
37 this.cache = new HashMap();
38 this.theTable="comment";
40 this.theEntityClass = Class.forName("mir.entity.EntityComment");
42 catch (Exception e) { throw new StorageObjectException(e.toString()); }
45 public SimpleList getPopupData() { return getPopupData("title",true); }
47 public boolean deleteByContentId(String id)
48 throws StorageObjectException {
54 /** @todo comments and topics should be deleted */
55 sql = "delete from "+ theTable + " where to_media="+id;
56 //theLog.printInfo("DELETE "+ sql);
60 stmt = con.createStatement();
61 res = stmt.executeUpdate(sql);
62 } catch (SQLException sqe) {
63 new StorageObjectException(sqe.toString());
66 freeConnection(con,stmt);