1 2 3 package org.tigris.scarab.om; 4 5 import java.math.BigDecimal ; 6 import java.util.Date ; 7 import java.util.List ; 8 9 import org.apache.torque.Torque; 10 import org.apache.torque.TorqueException; 11 import org.apache.torque.manager.AbstractBaseManager; 12 import org.apache.torque.manager.CacheListener; 13 import org.apache.torque.manager.MethodResultCache; 14 import org.apache.torque.om.ObjectKey; 15 import org.apache.torque.om.SimpleKey; 16 import org.apache.torque.om.Persistent; 17 import org.apache.torque.util.Criteria; 18 19 25 public abstract class BaseRModuleOptionManager 26 extends AbstractBaseManager 27 { 28 29 protected static String MANAGED_CLASS = "org.tigris.scarab.om.RModuleOption"; 30 31 32 protected static String DEFAULT_MANAGER_CLASS 33 = "org.tigris.scarab.om.RModuleOptionManager"; 34 35 41 public static RModuleOptionManager getManager() 42 { 43 return (RModuleOptionManager) 44 Torque.getManager(RModuleOptionManager.MANAGED_CLASS, 45 RModuleOptionManager.DEFAULT_MANAGER_CLASS); 46 } 47 48 54 public static RModuleOption getInstance() 55 throws TorqueException 56 { 57 return getManager().getInstanceImpl(); 58 } 59 60 67 public static RModuleOption getInstance(ObjectKey id) 68 throws TorqueException 69 { 70 return getManager().getInstanceImpl(id); 71 } 72 73 82 public static RModuleOption getInstance(ObjectKey id, boolean fromCache) 83 throws TorqueException 84 { 85 return getManager().getInstanceImpl(id, fromCache); 86 } 87 88 89 96 public static List getInstances(List ids) 97 throws TorqueException 98 { 99 return getManager().getInstancesImpl(ids); 100 } 101 102 111 public static List getInstances(List ids, boolean fromCache) 112 throws TorqueException 113 { 114 return getManager().getInstancesImpl(ids, fromCache); 115 } 116 117 public static void putInstance(Persistent om) 118 throws TorqueException 119 { 120 getManager().putInstanceImpl(om); 121 } 122 123 public static void clear() 124 throws TorqueException 125 { 126 getManager().clearImpl(); 127 } 128 129 public static boolean exists(RModuleOption obj) 130 throws TorqueException 131 { 132 return getManager().existsImpl(obj); 133 } 134 135 public static MethodResultCache getMethodResult() 136 { 137 return getManager().getMethodResultCache(); 138 } 139 140 public static void addCacheListener(CacheListener listener) 141 { 142 getManager().addCacheListenerImpl(listener); 143 } 144 145 150 public BaseRModuleOptionManager() 151 throws TorqueException 152 { 153 setClassName("org.tigris.scarab.om.RModuleOption"); 154 } 155 156 159 protected RModuleOption getInstanceImpl() 160 throws TorqueException 161 { 162 RModuleOption obj = null; 163 try 164 { 165 obj = (RModuleOption) getOMInstance(); 166 } 167 catch (Exception e) 168 { 169 throw new TorqueException(e); 170 } 171 return obj; 172 } 173 174 175 180 protected RModuleOption getInstanceImpl(ObjectKey id) 181 throws TorqueException 182 { 183 return (RModuleOption) getOMInstance(id); 184 } 185 186 193 protected RModuleOption getInstanceImpl(ObjectKey id, boolean fromCache) 194 throws TorqueException 195 { 196 return (RModuleOption) getOMInstance(id, fromCache); 197 } 198 199 206 protected List getInstancesImpl(List ids) 207 throws TorqueException 208 { 209 return getOMs(ids); 210 } 211 212 221 protected List getInstancesImpl(List ids, boolean fromCache) 222 throws TorqueException 223 { 224 return getOMs(ids, fromCache); 225 } 226 227 230 protected boolean existsImpl(RModuleOption om) 231 throws TorqueException 232 { 233 Criteria crit = RModuleOptionPeer 234 .buildCriteria((RModuleOption)om); 235 return RModuleOptionPeer.doSelect(crit).size() > 0; 236 } 237 238 239 protected Persistent retrieveStoredOM(ObjectKey id) 240 throws TorqueException 241 { 242 return RModuleOptionPeer.retrieveByPK(id); 243 } 244 245 252 protected List retrieveStoredOMs(List ids) 253 throws TorqueException 254 { 255 return RModuleOptionPeer.retrieveByPKs(ids); 256 } 257 } 258 | Popular Tags |