001: package org.tigris.scarab.om;
002:
003: import java.math.BigDecimal;
004: import java.util.Date;
005: import java.util.List;
006:
007: import org.apache.torque.Torque;
008: import org.apache.torque.TorqueException;
009: import org.apache.torque.manager.AbstractBaseManager;
010: import org.apache.torque.manager.CacheListener;
011: import org.apache.torque.manager.MethodResultCache;
012: import org.apache.torque.om.ObjectKey;
013: import org.apache.torque.om.SimpleKey;
014: import org.apache.torque.om.Persistent;
015: import org.apache.torque.util.Criteria;
016:
017: /**
018: * This class manages MITList objects.
019: * This class was autogenerated by Torque *
020: * You should not use this class directly. It should not even be
021: * extended all references should be to MITListManager
022: */
023: public abstract class BaseMITListManager extends AbstractBaseManager {
024: /** The name of the manager */
025: protected static final String MANAGED_CLASS = "org.tigris.scarab.om.MITList";
026:
027: /** The name of our class to pass to Torque as the default manager. */
028: protected static final String DEFAULT_MANAGER_CLASS = "org.tigris.scarab.om.MITListManager";
029:
030: /**
031: * Retrieves an implementation of the manager, based on the settings in
032: * the configuration.
033: *
034: * @return an implementation of MITListManager.
035: */
036: public static MITListManager getManager() {
037: return (MITListManager) Torque.getManager(
038: MITListManager.MANAGED_CLASS,
039: MITListManager.DEFAULT_MANAGER_CLASS);
040: }
041:
042: /**
043: * Static accessor for the @see #getInstanceImpl().
044: *
045: * @return a <code>MITList</code> value
046: * @exception TorqueException if an error occurs
047: */
048: public static MITList getInstance() throws TorqueException {
049: return getManager().getInstanceImpl();
050: }
051:
052: /**
053: * Static accessor for the @see #getInstanceImpl(ObjectKey).
054: *
055: * @param id an <code>ObjectKey</code> value
056: * @return a <code>MITList</code> value
057: * @exception TorqueException if an error occurs
058: */
059: public static MITList getInstance(ObjectKey id)
060: throws TorqueException {
061: return getManager().getInstanceImpl(id);
062: }
063:
064: /**
065: * Static accessor for the @see #getCachedInstanceImpl(ObjectKey).
066: * Loads <code>MITList</code> from cache, returns
067: * <code>null</code>, if instance is not in cache
068: *
069: * @param id an <code>ObjectKey</code> value
070: * @return a <code>MITList</code> value
071: * @exception TorqueException if an error occurs
072: */
073: public static MITList getCachedInstance(ObjectKey id)
074: throws TorqueException {
075: return getManager().getCachedInstanceImpl(id);
076: }
077:
078: /**
079: * Static accessor for the @see #getInstanceImpl(ObjectKey, boolean).
080: *
081: * @param id an <code>ObjectKey</code> value
082: * @param fromCache if true, look for cached MITLists before loading
083: * from storage.
084: * @return a <code>MITList</code> value
085: * @exception TorqueException if an error occurs
086: */
087: public static MITList getInstance(ObjectKey id, boolean fromCache)
088: throws TorqueException {
089: return getManager().getInstanceImpl(id, fromCache);
090: }
091:
092: /**
093: * Static accessor for the @see #getInstanceImpl(ObjectKey).
094: *
095: * @param id an <code>ObjectKey</code> value
096: * @return a <code>MITList</code> value
097: * @exception TorqueException if an error occurs
098: */
099: public static MITList getInstance(Long id) throws TorqueException {
100: return getManager().getInstanceImpl(SimpleKey.keyFor(id));
101: }
102:
103: /**
104: * Static accessor for the @see #getInstanceImpl(ObjectKey).
105: *
106: * @param id an <code>ObjectKey</code> value
107: * @param fromCache if true, look for cached MITLists before loading
108: * from storage.
109: * @return a <code>MITList</code> value
110: * @exception TorqueException if an error occurs
111: */
112: public static MITList getInstance(Long id, boolean fromCache)
113: throws TorqueException {
114: return getManager().getInstanceImpl(SimpleKey.keyFor(id),
115: fromCache);
116: }
117:
118: /**
119: * Static accessor for the @see #getInstancesImpl(List).
120: *
121: * @param ids a <code>List</code> value
122: * @return a <code>List</code> value
123: * @exception TorqueException if an error occurs
124: */
125: public static List getInstances(List ids) throws TorqueException {
126: return getManager().getInstancesImpl(ids);
127: }
128:
129: /**
130: * Static accessor for the @see #getInstancesImpl(List, boolean).
131: *
132: * @param ids a <code>List</code> value
133: * @param fromCache if true, look for cached MITLists before loading
134: * from storage.
135: * @return a <code>List</code> value
136: * @exception TorqueException if an error occurs
137: */
138: public static List getInstances(List ids, boolean fromCache)
139: throws TorqueException {
140: return getManager().getInstancesImpl(ids, fromCache);
141: }
142:
143: public static void putInstance(Persistent om)
144: throws TorqueException {
145: getManager().putInstanceImpl(om);
146: }
147:
148: public static void clear() throws TorqueException {
149: getManager().clearImpl();
150: }
151:
152: public static boolean exists(MITList obj) throws TorqueException {
153: return getManager().existsImpl(obj);
154: }
155:
156: public static MethodResultCache getMethodResult() {
157: return getManager().getMethodResultCache();
158: }
159:
160: public static void addCacheListener(CacheListener listener) {
161: getManager().addCacheListenerImpl(listener);
162: }
163:
164: /**
165: * Creates a new <code>BaseMITListManager</code> instance.
166: *
167: * @exception TorqueException if an error occurs
168: */
169: public BaseMITListManager() throws TorqueException {
170: setClassName("org.tigris.scarab.om.MITList");
171: }
172:
173: /**
174: * Get a fresh instance of a MITListManager
175: */
176: protected MITList getInstanceImpl() throws TorqueException {
177: MITList obj = null;
178: try {
179: obj = (MITList) getOMInstance();
180: } catch (Exception e) {
181: throw new TorqueException(e);
182: }
183: return obj;
184: }
185:
186: /**
187: * Get a MITList with the given id.
188: *
189: * @param id <code>ObjectKey</code> value
190: */
191: protected MITList getInstanceImpl(ObjectKey id)
192: throws TorqueException {
193: return (MITList) getOMInstance(id);
194: }
195:
196: /**
197: * Get a MITList with the given id from the cache. Returns
198: * <code>null</code> if instance is not in cache
199: *
200: * @param id <code>ObjectKey</code> value
201: */
202: protected MITList getCachedInstanceImpl(ObjectKey id)
203: throws TorqueException {
204: return (MITList) cacheGet(id);
205: }
206:
207: /**
208: * Get a MITList with the given id.
209: *
210: * @param id <code>ObjectKey</code> value
211: * @param fromCache if true, look for cached MITLists before loading
212: * from storage.
213: */
214: protected MITList getInstanceImpl(ObjectKey id, boolean fromCache)
215: throws TorqueException {
216: return (MITList) getOMInstance(id, fromCache);
217: }
218:
219: /**
220: * Gets a list of MITLists based on id's.
221: *
222: * @param ids a List of <code>ObjectKeys</code> value
223: * @return a <code>List</code> of MITLists
224: * @exception TorqueException if an error occurs
225: */
226: protected List getInstancesImpl(List ids) throws TorqueException {
227: return getOMs(ids);
228: }
229:
230: /**
231: * Gets a list of MITLists based on id's.
232: *
233: * @param ids a List of <code>ObjectKeys</code> value
234: * @param fromCache if true, look for cached MITLists before loading
235: * from storage.
236: * @return a <code>List</code> of MITLists
237: * @exception TorqueException if an error occurs
238: */
239: protected List getInstancesImpl(List ids, boolean fromCache)
240: throws TorqueException {
241: return getOMs(ids, fromCache);
242: }
243:
244: /**
245: * check for a duplicate project name
246: */
247: protected boolean existsImpl(MITList om) throws TorqueException {
248: Criteria crit = MITListPeer.buildCriteria((MITList) om);
249: return MITListPeer.doSelect(crit).size() > 0;
250: }
251:
252: protected Persistent retrieveStoredOM(ObjectKey id)
253: throws TorqueException {
254: return MITListPeer.retrieveByPK(id);
255: }
256:
257: /**
258: * Gets a list of ModuleEntities based on id's.
259: *
260: * @param ids a <code>NumberKey[]</code> value
261: * @return a <code>List</code> value
262: * @exception TorqueException if an error occurs
263: */
264: protected List retrieveStoredOMs(List ids) throws TorqueException {
265: return MITListPeer.retrieveByPKs(ids);
266: }
267: }
|