KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > tigris > scarab > om > BaseConditionManager


1
2
3 package org.tigris.scarab.om;
4
5 import java.math.BigDecimal JavaDoc;
6 import java.util.Date JavaDoc;
7 import java.util.List JavaDoc;
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 /**
20  * This class manages Condition objects.
21  * This class was autogenerated by Torque *
22  * You should not use this class directly. It should not even be
23  * extended all references should be to ConditionManager
24  */

25 public abstract class BaseConditionManager
26     extends AbstractBaseManager
27 {
28     /** The name of the manager */
29     protected static String JavaDoc MANAGED_CLASS = "org.tigris.scarab.om.Condition";
30
31     /** The name of our class to pass to Torque as the default manager. */
32     protected static String JavaDoc DEFAULT_MANAGER_CLASS
33         = "org.tigris.scarab.om.ConditionManager";
34
35     /**
36      * Retrieves an implementation of the manager, based on the settings in
37      * the configuration.
38      *
39      * @return an implementation of ConditionManager.
40      */

41     public static ConditionManager getManager()
42     {
43         return (ConditionManager)
44             Torque.getManager(ConditionManager.MANAGED_CLASS,
45                 ConditionManager.DEFAULT_MANAGER_CLASS);
46     }
47
48     /**
49      * Static accessor for the @see #getInstanceImpl().
50      *
51      * @return a <code>Condition</code> value
52      * @exception TorqueException if an error occurs
53      */

54     public static Condition getInstance()
55         throws TorqueException
56     {
57         return getManager().getInstanceImpl();
58     }
59
60     /**
61      * Static accessor for the @see #getInstanceImpl(ObjectKey).
62      *
63      * @param id an <code>ObjectKey</code> value
64      * @return a <code>Condition</code> value
65      * @exception TorqueException if an error occurs
66      */

67     public static Condition getInstance(ObjectKey id)
68         throws TorqueException
69     {
70         return getManager().getInstanceImpl(id);
71     }
72
73     /**
74      * Static accessor for the @see #getInstanceImpl(ObjectKey, boolean).
75      *
76      * @param id an <code>ObjectKey</code> value
77      * @param fromCache if true, look for cached Conditions before loading
78      * from storage.
79      * @return a <code>Condition</code> value
80      * @exception TorqueException if an error occurs
81      */

82     public static Condition getInstance(ObjectKey id, boolean fromCache)
83         throws TorqueException
84     {
85         return getManager().getInstanceImpl(id, fromCache);
86     }
87
88     /**
89      * Static accessor for the @see #getInstanceImpl(ObjectKey).
90      *
91      * @param id an <code>ObjectKey</code> value
92      * @return a <code>Condition</code> value
93      * @exception TorqueException if an error occurs
94      */

95     public static Condition getInstance(Long JavaDoc id)
96         throws TorqueException
97     {
98         return getManager().getInstanceImpl(SimpleKey.keyFor(id));
99     }
100
101     /**
102      * Static accessor for the @see #getInstanceImpl(ObjectKey).
103      *
104      * @param id an <code>ObjectKey</code> value
105      * @param fromCache if true, look for cached Conditions before loading
106      * from storage.
107      * @return a <code>Condition</code> value
108      * @exception TorqueException if an error occurs
109      */

110     public static Condition getInstance(Long JavaDoc id, boolean fromCache)
111         throws TorqueException
112     {
113         return getManager().getInstanceImpl(SimpleKey.keyFor(id), fromCache);
114     }
115
116     /**
117      * Static accessor for the @see #getInstancesImpl(List).
118      *
119      * @param ids a <code>List</code> value
120      * @return a <code>List</code> value
121      * @exception TorqueException if an error occurs
122      */

123     public static List JavaDoc getInstances(List JavaDoc ids)
124         throws TorqueException
125     {
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 Conditions before loading
134      * from storage.
135      * @return a <code>List</code> value
136      * @exception TorqueException if an error occurs
137      */

138     public static List JavaDoc getInstances(List JavaDoc ids, boolean fromCache)
139         throws TorqueException
140     {
141         return getManager().getInstancesImpl(ids, fromCache);
142     }
143
144     public static void putInstance(Persistent om)
145         throws TorqueException
146     {
147         getManager().putInstanceImpl(om);
148     }
149
150     public static void clear()
151         throws TorqueException
152     {
153         getManager().clearImpl();
154     }
155
156     public static boolean exists(Condition obj)
157         throws TorqueException
158     {
159         return getManager().existsImpl(obj);
160     }
161
162     public static MethodResultCache getMethodResult()
163     {
164         return getManager().getMethodResultCache();
165     }
166
167     public static void addCacheListener(CacheListener listener)
168     {
169         getManager().addCacheListenerImpl(listener);
170     }
171
172     /**
173      * Creates a new <code>BaseConditionManager</code> instance.
174      *
175      * @exception TorqueException if an error occurs
176      */

177     public BaseConditionManager()
178         throws TorqueException
179     {
180         setClassName("org.tigris.scarab.om.Condition");
181     }
182
183     /**
184      * Get a fresh instance of a ConditionManager
185      */

186     protected Condition getInstanceImpl()
187         throws TorqueException
188     {
189         Condition obj = null;
190         try
191         {
192             obj = (Condition) getOMInstance();
193         }
194         catch (Exception JavaDoc e)
195         {
196             throw new TorqueException(e);
197         }
198         return obj;
199     }
200
201
202     /**
203      * Get a Condition with the given id.
204      *
205      * @param id <code>ObjectKey</code> value
206      */

207     protected Condition getInstanceImpl(ObjectKey id)
208         throws TorqueException
209     {
210         return (Condition) getOMInstance(id);
211     }
212
213     /**
214      * Get a Condition with the given id.
215      *
216      * @param id <code>ObjectKey</code> value
217      * @param fromCache if true, look for cached Conditions before loading
218      * from storage.
219      */

220     protected Condition getInstanceImpl(ObjectKey id, boolean fromCache)
221         throws TorqueException
222     {
223         return (Condition) getOMInstance(id, fromCache);
224     }
225
226     /**
227      * Gets a list of Conditions based on id's.
228      *
229      * @param ids a List of <code>ObjectKeys</code> value
230      * @return a <code>List</code> of Conditions
231      * @exception TorqueException if an error occurs
232      */

233     protected List JavaDoc getInstancesImpl(List JavaDoc ids)
234         throws TorqueException
235     {
236         return getOMs(ids);
237     }
238
239     /**
240      * Gets a list of Conditions based on id's.
241      *
242      * @param ids a List of <code>ObjectKeys</code> value
243      * @param fromCache if true, look for cached Conditions before loading
244      * from storage.
245      * @return a <code>List</code> of Conditions
246      * @exception TorqueException if an error occurs
247      */

248     protected List JavaDoc getInstancesImpl(List JavaDoc ids, boolean fromCache)
249         throws TorqueException
250     {
251         return getOMs(ids, fromCache);
252     }
253
254     /**
255      * check for a duplicate project name
256      */

257     protected boolean existsImpl(Condition om)
258         throws TorqueException
259     {
260         Criteria crit = ConditionPeer
261             .buildCriteria((Condition)om);
262         return ConditionPeer.doSelect(crit).size() > 0;
263     }
264
265
266     protected Persistent retrieveStoredOM(ObjectKey id)
267         throws TorqueException
268     {
269         return ConditionPeer.retrieveByPK(id);
270     }
271
272     /**
273      * Gets a list of ModuleEntities based on id's.
274      *
275      * @param ids a <code>NumberKey[]</code> value
276      * @return a <code>List</code> value
277      * @exception TorqueException if an error occurs
278      */

279     protected List JavaDoc retrieveStoredOMs(List JavaDoc ids)
280         throws TorqueException
281     {
282         return ConditionPeer.retrieveByPKs(ids);
283     }
284 }
285
Popular Tags