1 package mircoders.entity;
15 * This class maps one line of the comment-table to a java-object.
22 public class EntityComment extends AbstractEntity implements Entity
24 private static int instances;
26 public EntityComment()
32 public EntityComment(StorageObject theStorage) {
34 setStorage(theStorage);
37 public HashMap getValues() {
38 HashMap returnHash = super.getValues();
39 String create = (String)returnHash.get("webdb_create");
40 returnHash.put("date",StringUtil.dateToReadableDate(create));
46 * overridden method setValues to patch creator_main_url
48 public void setValues(HashMap theStringValues)
50 if (theStringValues != null) {
51 if (!theStringValues.containsKey("is_published")) {
52 theStringValues.put("is_published","0");
55 if (theStringValues.containsKey("main_url")){
56 theLog.printDebugInfo("------------------ http");
57 if (((String)theStringValues.get("main_url")).equalsIgnoreCase("http://")) {
58 theLog.printDebugInfo("laenge1: "+((String)theStringValues.get("main_url")).length());
59 theStringValues.remove("main_url");
60 } else if ((!((String)theStringValues.get("main_url")).startsWith("http://"))
61 && ((String)theStringValues.get("main_url")).length()>0){
62 theLog.printDebugInfo("laenge2: "+((String)theStringValues.get("main_url")).length());
63 theStringValues.put("main_url","http://"+((String)theStringValues.get("main_url")));
68 super.setValues(theStringValues);
72 public void finalize() {