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.RequestContext; 69 import com.jcorporate.expresso.core.dbobj.SecuredDBObject; 70 import com.jcorporate.expresso.core.misc.ConfigManager; 71 72 73 80 public class DBOtherMap 81 extends SecuredDBObject { 82 83 public static final String DB_OBJECT_NAME = "DBObjName"; 84 public static final String DESCRIP = "Descrip"; 85 public static final String DB_CONN_NAME = "DBConnName"; 86 87 92 public DBOtherMap() 93 throws DBException { 94 super(); 95 } 96 97 98 102 public DBOtherMap(int uid) 103 throws DBException { 104 super(uid); 105 } 106 107 114 public DBOtherMap(RequestContext request) 115 throws DBException { 116 super(request); 117 } 118 119 124 public void setupFields() 125 throws DBException { 126 setTargetTable("DBOTHERMAP"); 127 setDescription("DBotherMap"); 128 addField(DB_OBJECT_NAME, "varchar", 250, false, "dbobjName"); 129 addField(DB_CONN_NAME, "char", 30, false, "context"); 130 addField(DESCRIP, "varchar", 200, true, "description"); 131 setStringFilter(DB_OBJECT_NAME, "stripFilter"); 132 setStringFilter(DB_CONN_NAME, "stripFilter"); 133 addKey(DB_OBJECT_NAME); 134 } 135 136 144 public synchronized void add() 145 throws com.jcorporate.expresso.core.db.DBException { 146 super.add(); 147 try { 148 ConfigManager.mapOtherDBs(); 149 } catch (com.jcorporate.expresso.core.misc.ConfigurationException ce) { 150 throw new DBException("Error updating the other db mappings." + 151 " You will need to restart the servlet container" + 152 " for changes to take affect"); 153 } 154 } 155 156 164 public synchronized void delete() 165 throws com.jcorporate.expresso.core.db.DBException { 166 super.delete(); 167 try { 168 ConfigManager.mapOtherDBs(); 169 } catch (com.jcorporate.expresso.core.misc.ConfigurationException ce) { 170 throw new DBException("Error updating the other db mappings." + 171 " You will need to restart the servlet container" + 172 " for changes to take affect"); 173 } 174 } 175 176 184 public synchronized void update() 185 throws com.jcorporate.expresso.core.db.DBException { 186 super.update(); 187 try { 188 ConfigManager.mapOtherDBs(); 189 } catch (com.jcorporate.expresso.core.misc.ConfigurationException ce) { 190 throw new DBException("Error updating the other db mappings." + 191 " You will need to restart the servlet container" + 192 " for changes to take affect"); 193 } 194 } 195 196 197 } 198 199 | Popular Tags |