1 package mircoders.storage;
8 import freemarker.template.*;
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("mircoders.entity.EntityComment");
42 catch (Exception e) { throw new StorageObjectException(e.toString()); }
45 public SimpleList getPopupData()
46 throws StorageObjectException { return getPopupData("title",true); }
48 public boolean deleteByContentId(String id)
49 throws StorageObjectException {
55 /** @todo comments and topics should be deleted */
56 sql = "delete from "+ theTable + " where to_media="+id;
57 //theLog.printInfo("DELETE "+ sql);
61 stmt = con.createStatement();
62 res = stmt.executeUpdate(sql);
63 } catch (SQLException sqe) {
64 new StorageObjectException(sqe.toString());
67 freeConnection(con,stmt);