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 BaseMITListItemManager 26 extends AbstractBaseManager 27 { 28 29 protected static String MANAGED_CLASS = "org.tigris.scarab.om.MITListItem"; 30 31 32 protected static String DEFAULT_MANAGER_CLASS 33 = "org.tigris.scarab.om.MITListItemManager"; 34 35 41 public static MITListItemManager getManager() 42 { 43 return (MITListItemManager) 44 Torque.getManager(MITListItemManager.MANAGED_CLASS, 45 MITListItemManager.DEFAULT_MANAGER_CLASS); 46 } 47 48 54 public static MITListItem getInstance() 55 throws TorqueException 56 { 57 return getManager().getInstanceImpl(); 58 } 59 60 67 public static MITListItem getInstance(ObjectKey id) 68 throws TorqueException 69 { 70 return getManager().getInstanceImpl(id); 71 } 72 73 82 public static MITListItem getInstance(ObjectKey id, boolean fromCache) 83 throws TorqueException 84 { 85 return getManager().getInstanceImpl(id, fromCache); 86 } 87 88 95 public static MITListItem getInstance(Long id) 96 throws TorqueException 97 { 98 return getManager().getInstanceImpl(SimpleKey.keyFor(id)); 99 } 100 101 110 public static MITListItem getInstance(Long id, boolean fromCache) 111 throws TorqueException 112 { 113 return getManager().getInstanceImpl(SimpleKey.keyFor(id), fromCache); 114 } 115 116 123 public static List getInstances(List ids) 124 throws TorqueException 125 { 126 return getManager().getInstancesImpl(ids); 127 } 128 129 138 public static List getInstances(List ids, boolean fromCache) 139 throws TorqueException 140 { 141 return getManager().getInstancesImpl(ids, fromCache); 142 } 143 144 public static void putInstance(Persistent om) 145 throws TorqueException 146 { 147 getManager().putInstanceImpl(om); 148 } 149 150 public static void clear() 151 throws TorqueException 152 { 153 getManager().clearImpl(); 154 } 155 156 public static boolean exists(MITListItem obj) 157 throws TorqueException 158 { 159 return getManager().existsImpl(obj); 160 } 161 162 public static MethodResultCache getMethodResult() 163 { 164 return getManager().getMethodResultCache(); 165 } 166 167 public static void addCacheListener(CacheListener listener) 168 { 169 getManager().addCacheListenerImpl(listener); 170 } 171 172 177 public BaseMITListItemManager() 178 throws TorqueException 179 { 180 setClassName("org.tigris.scarab.om.MITListItem"); 181 } 182 183 186 protected MITListItem getInstanceImpl() 187 throws TorqueException 188 { 189 MITListItem obj = null; 190 try 191 { 192 obj = (MITListItem) getOMInstance(); 193 } 194 catch (Exception e) 195 { 196 throw new TorqueException(e); 197 } 198 return obj; 199 } 200 201 202 207 protected MITListItem getInstanceImpl(ObjectKey id) 208 throws TorqueException 209 { 210 return (MITListItem) getOMInstance(id); 211 } 212 213 220 protected MITListItem getInstanceImpl(ObjectKey id, boolean fromCache) 221 throws TorqueException 222 { 223 return (MITListItem) getOMInstance(id, fromCache); 224 } 225 226 233 protected List getInstancesImpl(List ids) 234 throws TorqueException 235 { 236 return getOMs(ids); 237 } 238 239 248 protected List getInstancesImpl(List ids, boolean fromCache) 249 throws TorqueException 250 { 251 return getOMs(ids, fromCache); 252 } 253 254 257 protected boolean existsImpl(MITListItem om) 258 throws TorqueException 259 { 260 Criteria crit = MITListItemPeer 261 .buildCriteria((MITListItem)om); 262 return MITListItemPeer.doSelect(crit).size() > 0; 263 } 264 265 266 protected Persistent retrieveStoredOM(ObjectKey id) 267 throws TorqueException 268 { 269 return MITListItemPeer.retrieveByPK(id); 270 } 271 272 279 protected List retrieveStoredOMs(List ids) 280 throws TorqueException 281 { 282 return MITListItemPeer.retrieveByPKs(ids); 283 } 284 } 285 | Popular Tags |