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