1 64 65 package com.jcorporate.expresso.services.dbobj; 66 67 import com.jcorporate.expresso.core.db.DBException; 68 import com.jcorporate.expresso.core.dbobj.DBObject; 69 import com.jcorporate.expresso.core.i18n.Messages; 70 71 import java.util.Date ; 72 73 74 84 85 public class ChangeLog 86 extends DBObject { 87 91 public ChangeLog() 92 throws DBException { 93 super(); 94 } 95 96 101 public synchronized void add() 102 throws DBException { 103 111 setField("ChangeTime", new Date ()); 112 super.add(); 113 114 } 115 116 117 122 protected synchronized void setupFields() 123 throws DBException { 124 setTargetTable("CHANGELOGTWO"); 125 addField("ChangeKey", "auto-inc", 0, false, "Changelog Key"); 126 addKey("ChangeKey"); 127 128 addField("ObjectChanged", "varchar", 40, false, "Object_Changed"); 129 addField("RecordKey", "varchar", 150, false, "Key_of_Changed_Object"); 130 addField("Operation", "char", 1, false, "Operation_Code"); 131 132 133 addField("ChangedField", "varchar", 40, false, "Field_Changed"); 134 135 136 addField("ChangeTime", "datetime", 0, false, "Time_of_Change"); 137 138 144 145 addField("OldValue", "varchar", 255, true, "Old_Field_Value"); 146 addField("NewValue", "varchar", 255, true, "New_Field_Value"); 147 } 148 149 150 154 public synchronized void update() 155 throws DBException { 156 throw new DBException(Messages.getString("Updates_to_ChangeLog_object_not_permitted")); 157 } 158 159 } 160 161 162 | Popular Tags |