1 64 65 package com.jcorporate.expresso.ext.dbobj; 66 67 import com.jcorporate.expresso.core.db.DBConnection; 68 import com.jcorporate.expresso.core.db.DBException; 69 import com.jcorporate.expresso.core.dbobj.DBObject; 70 import com.jcorporate.expresso.core.dbobj.SecuredDBObject; 71 import com.jcorporate.expresso.core.misc.DateTime; 72 73 79 public class AuditLog extends SecuredDBObject { 80 81 86 public AuditLog() throws DBException { 87 super(); 88 } 89 90 91 99 public AuditLog(DBConnection theConnection) throws DBException { 100 super(theConnection); 101 } 102 103 104 107 protected synchronized void setupFields() throws DBException { 108 setTargetTable("AUDITLOG"); 109 110 setDescription("Audit Log"); 111 112 addField("AUDITLOG_ID", "auto-inc", 0, false, "AuditLog ID"); 113 addField("AUDITLOG_CODE", "char", 5, false, "AuditLog Code"); 115 addField("EXPUID", "integer", 0, false, "EXP ID"); 117 addField("AUDITLOG_DATE", "datetime", 0, false, "AuditLog Date"); 119 addField("AUDITLOG_DES", "varchar", 250, true, "AuditLog Description"); 121 122 addKey("AUDITLOG_ID"); 123 setMultiValued("AUDITLOG_CODE"); 124 setLookupObject("AUDITLOG_CODE", "com.jcorporate.expresso.ext.dbobj.AuditLogL"); 125 this.setReadOnly("AUDITLOG_ID"); 126 this.setReadOnly("AUDITLOG_CODE"); 127 this.setReadOnly("EXPUID"); 128 this.setReadOnly("AUDITLOG_DATE"); 129 this.setReadOnly("AUDITLOG_DES"); 130 131 } 132 133 136 137 public synchronized void add() throws DBException { 138 setField("AUDITLOG_DATE", DateTime.getDateTimeForDB(this.getDataContext())); 139 super.add(); 140 } 141 142 149 public DBObject getThisDBObj() throws DBException { 150 return new AuditLog(); 151 } 152 } 153 154 | Popular Tags |