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 IssueVote 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 IssueVoteManager
022: */
023: public abstract class BaseIssueVoteManager extends AbstractBaseManager {
024: /** The name of the manager */
025: protected static final String MANAGED_CLASS = "org.tigris.scarab.om.IssueVote";
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.IssueVoteManager";
029:
030: /**
031: * Retrieves an implementation of the manager, based on the settings in
032: * the configuration.
033: *
034: * @return an implementation of IssueVoteManager.
035: */
036: public static IssueVoteManager getManager() {
037: return (IssueVoteManager) Torque.getManager(
038: IssueVoteManager.MANAGED_CLASS,
039: IssueVoteManager.DEFAULT_MANAGER_CLASS);
040: }
041:
042: /**
043: * Static accessor for the @see #getInstanceImpl().
044: *
045: * @return a <code>IssueVote</code> value
046: * @exception TorqueException if an error occurs
047: */
048: public static IssueVote 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>IssueVote</code> value
057: * @exception TorqueException if an error occurs
058: */
059: public static IssueVote 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>IssueVote</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>IssueVote</code> value
071: * @exception TorqueException if an error occurs
072: */
073: public static IssueVote 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 IssueVotes before loading
083: * from storage.
084: * @return a <code>IssueVote</code> value
085: * @exception TorqueException if an error occurs
086: */
087: public static IssueVote getInstance(ObjectKey id, boolean fromCache)
088: throws TorqueException {
089: return getManager().getInstanceImpl(id, fromCache);
090: }
091:
092: /**
093: * Static accessor for the @see #getInstancesImpl(List).
094: *
095: * @param ids a <code>List</code> value
096: * @return a <code>List</code> value
097: * @exception TorqueException if an error occurs
098: */
099: public static List getInstances(List ids) throws TorqueException {
100: return getManager().getInstancesImpl(ids);
101: }
102:
103: /**
104: * Static accessor for the @see #getInstancesImpl(List, boolean).
105: *
106: * @param ids a <code>List</code> value
107: * @param fromCache if true, look for cached IssueVotes before loading
108: * from storage.
109: * @return a <code>List</code> value
110: * @exception TorqueException if an error occurs
111: */
112: public static List getInstances(List ids, boolean fromCache)
113: throws TorqueException {
114: return getManager().getInstancesImpl(ids, fromCache);
115: }
116:
117: public static void putInstance(Persistent om)
118: throws TorqueException {
119: getManager().putInstanceImpl(om);
120: }
121:
122: public static void clear() throws TorqueException {
123: getManager().clearImpl();
124: }
125:
126: public static boolean exists(IssueVote obj) throws TorqueException {
127: return getManager().existsImpl(obj);
128: }
129:
130: public static MethodResultCache getMethodResult() {
131: return getManager().getMethodResultCache();
132: }
133:
134: public static void addCacheListener(CacheListener listener) {
135: getManager().addCacheListenerImpl(listener);
136: }
137:
138: /**
139: * Creates a new <code>BaseIssueVoteManager</code> instance.
140: *
141: * @exception TorqueException if an error occurs
142: */
143: public BaseIssueVoteManager() throws TorqueException {
144: setClassName("org.tigris.scarab.om.IssueVote");
145: }
146:
147: /**
148: * Get a fresh instance of a IssueVoteManager
149: */
150: protected IssueVote getInstanceImpl() throws TorqueException {
151: IssueVote obj = null;
152: try {
153: obj = (IssueVote) getOMInstance();
154: } catch (Exception e) {
155: throw new TorqueException(e);
156: }
157: return obj;
158: }
159:
160: /**
161: * Get a IssueVote with the given id.
162: *
163: * @param id <code>ObjectKey</code> value
164: */
165: protected IssueVote getInstanceImpl(ObjectKey id)
166: throws TorqueException {
167: return (IssueVote) getOMInstance(id);
168: }
169:
170: /**
171: * Get a IssueVote with the given id from the cache. Returns
172: * <code>null</code> if instance is not in cache
173: *
174: * @param id <code>ObjectKey</code> value
175: */
176: protected IssueVote getCachedInstanceImpl(ObjectKey id)
177: throws TorqueException {
178: return (IssueVote) cacheGet(id);
179: }
180:
181: /**
182: * Get a IssueVote with the given id.
183: *
184: * @param id <code>ObjectKey</code> value
185: * @param fromCache if true, look for cached IssueVotes before loading
186: * from storage.
187: */
188: protected IssueVote getInstanceImpl(ObjectKey id, boolean fromCache)
189: throws TorqueException {
190: return (IssueVote) getOMInstance(id, fromCache);
191: }
192:
193: /**
194: * Gets a list of IssueVotes based on id's.
195: *
196: * @param ids a List of <code>ObjectKeys</code> value
197: * @return a <code>List</code> of IssueVotes
198: * @exception TorqueException if an error occurs
199: */
200: protected List getInstancesImpl(List ids) throws TorqueException {
201: return getOMs(ids);
202: }
203:
204: /**
205: * Gets a list of IssueVotes based on id's.
206: *
207: * @param ids a List of <code>ObjectKeys</code> value
208: * @param fromCache if true, look for cached IssueVotes before loading
209: * from storage.
210: * @return a <code>List</code> of IssueVotes
211: * @exception TorqueException if an error occurs
212: */
213: protected List getInstancesImpl(List ids, boolean fromCache)
214: throws TorqueException {
215: return getOMs(ids, fromCache);
216: }
217:
218: /**
219: * check for a duplicate project name
220: */
221: protected boolean existsImpl(IssueVote om) throws TorqueException {
222: Criteria crit = IssueVotePeer.buildCriteria((IssueVote) om);
223: return IssueVotePeer.doSelect(crit).size() > 0;
224: }
225:
226: protected Persistent retrieveStoredOM(ObjectKey id)
227: throws TorqueException {
228: return IssueVotePeer.retrieveByPK(id);
229: }
230:
231: /**
232: * Gets a list of ModuleEntities based on id's.
233: *
234: * @param ids a <code>NumberKey[]</code> value
235: * @return a <code>List</code> value
236: * @exception TorqueException if an error occurs
237: */
238: protected List retrieveStoredOMs(List ids) throws TorqueException {
239: return IssueVotePeer.retrieveByPKs(ids);
240: }
241: }
|