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