1 2 3 package org.apache.jetspeed.om.apps.email; 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 29 public abstract class BaseEmailInboxManager 30 extends AbstractBaseManager 31 { 32 33 protected static String MANAGED_CLASS = "org.apache.jetspeed.om.apps.email.EmailInbox"; 34 35 36 protected static String DEFAULT_MANAGER_CLASS 37 = "org.apache.jetspeed.om.apps.email.EmailInboxManager"; 38 39 45 public static EmailInboxManager getManager() 46 { 47 return (EmailInboxManager) 48 Torque.getManager(EmailInboxManager.MANAGED_CLASS, 49 EmailInboxManager.DEFAULT_MANAGER_CLASS); 50 } 51 52 58 public static EmailInbox getInstance() 59 throws TorqueException 60 { 61 return getManager().getInstanceImpl(); 62 } 63 64 71 public static EmailInbox getInstance(ObjectKey id) 72 throws TorqueException 73 { 74 return getManager().getInstanceImpl(id); 75 } 76 77 84 public static EmailInbox getInstance(ObjectKey id, boolean fromCache) 85 throws TorqueException 86 { 87 return getManager().getInstanceImpl(id, fromCache); 88 } 89 90 97 public static EmailInbox getInstance(int id) 98 throws TorqueException 99 { 100 return getManager().getInstanceImpl(SimpleKey.keyFor(id)); 101 } 102 103 110 public static EmailInbox getInstance(int 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 136 public static List getInstances(List ids, boolean fromCache) 137 throws TorqueException 138 { 139 return getManager().getInstancesImpl(ids, fromCache); 140 } 141 142 public static void putInstance(Persistent om) 143 throws TorqueException 144 { 145 getManager().putInstanceImpl(om); 146 } 147 148 public static void clear() 149 throws TorqueException 150 { 151 getManager().clearImpl(); 152 } 153 154 public static boolean exists(EmailInbox obj) 155 throws TorqueException 156 { 157 return getManager().existsImpl(obj); 158 } 159 160 public static MethodResultCache getMethodResult() 161 { 162 return getManager().getMethodResultCache(); 163 } 164 165 public static void addCacheListener(CacheListener listener) 166 { 167 getManager().addCacheListenerImpl(listener); 168 } 169 170 175 public BaseEmailInboxManager() 176 throws TorqueException 177 { 178 setClassName("org.apache.jetspeed.om.apps.email.EmailInbox"); 179 } 180 181 184 protected EmailInbox getInstanceImpl() 185 throws TorqueException 186 { 187 EmailInbox obj = null; 188 try 189 { 190 obj = (EmailInbox) getOMInstance(); 191 } 192 catch (Exception e) 193 { 194 throw new TorqueException(e); 195 } 196 return obj; 197 } 198 199 200 205 protected EmailInbox getInstanceImpl(ObjectKey id) 206 throws TorqueException 207 { 208 return (EmailInbox) getOMInstance(id); 209 } 210 211 218 protected EmailInbox getInstanceImpl(ObjectKey id, boolean fromCache) 219 throws TorqueException 220 { 221 return (EmailInbox) getOMInstance(id, fromCache); 222 } 223 224 231 protected List getInstancesImpl(List ids) 232 throws TorqueException 233 { 234 return getOMs(ids); 235 } 236 237 246 protected List getInstancesImpl(List ids, boolean fromCache) 247 throws TorqueException 248 { 249 return getOMs(ids, fromCache); 250 } 251 252 255 protected boolean existsImpl(EmailInbox om) 256 throws TorqueException 257 { 258 Criteria crit = EmailInboxPeer 259 .buildCriteria((EmailInbox)om); 260 return EmailInboxPeer.doSelect(crit).size() > 0; 261 } 262 263 264 protected Persistent retrieveStoredOM(ObjectKey id) 265 throws TorqueException 266 { 267 return EmailInboxPeer.retrieveByPK(id); 268 } 269 270 277 protected List retrieveStoredOMs(List ids) 278 throws TorqueException 279 { 280 return EmailInboxPeer.retrieveByPKs(ids); 281 } 282 } 283 | Popular Tags |