KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > jetspeed > om > dbregistry > BasePortletDbEntryManager


1
2
3 package org.apache.jetspeed.om.dbregistry;
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 PortletDbEntry objects.
21  * This class was autogenerated by Torque on:
22  *
23  * [Thu Apr 22 15:30:48 PDT 2004]
24  *
25   *
26  * You should not use this class directly. It should not even be
27  * extended all references should be to PortletDbEntryManager
28  */

29 public abstract class BasePortletDbEntryManager
30     extends AbstractBaseManager
31 {
32     /** The name of the manager */
33     protected static String JavaDoc MANAGED_CLASS = "org.apache.jetspeed.om.dbregistry.PortletDbEntry";
34
35     /** The name of our class to pass to Torque as the default manager. */
36     protected static String JavaDoc DEFAULT_MANAGER_CLASS
37         = "org.apache.jetspeed.om.dbregistry.PortletDbEntryManager";
38
39     /**
40      * Retrieves an implementation of the manager, based on the settings in
41      * the configuration.
42      *
43      * @return an implementation of PortletDbEntryManager.
44      */

45     public static PortletDbEntryManager getManager()
46     {
47         return (PortletDbEntryManager)
48             Torque.getManager(PortletDbEntryManager.MANAGED_CLASS,
49                 PortletDbEntryManager.DEFAULT_MANAGER_CLASS);
50     }
51
52     /**
53      * Static accessor for the @see #getInstanceImpl().
54      *
55      * @return a <code>PortletDbEntry</code> value
56      * @exception TorqueException if an error occurs
57      */

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

71     public static PortletDbEntry getInstance(ObjectKey id)
72         throws TorqueException
73     {
74         return getManager().getInstanceImpl(id);
75     }
76
77     /**
78      * Static accessor for the @see #getInstanceImpl(ObjectKey, boolean).
79      *
80      * @param id an <code>ObjectKey</code> value
81      * @return a <code>PortletDbEntry</code> value
82      * @exception TorqueException if an error occurs
83      */

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

97     public static PortletDbEntry getInstance(long id)
98         throws TorqueException
99     {
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      * @return a <code>PortletDbEntry</code> value
108      * @exception TorqueException if an error occurs
109      */

110     public static PortletDbEntry getInstance(long 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      * @return a <code>List</code> value
134      * @exception TorqueException if an error occurs
135      */

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

175     public BasePortletDbEntryManager()
176         throws TorqueException
177     {
178         setClassName("org.apache.jetspeed.om.dbregistry.PortletDbEntry");
179     }
180
181     /**
182      * Get a fresh instance of a PortletDbEntryManager
183      */

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

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

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

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

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

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

277     protected List JavaDoc retrieveStoredOMs(List JavaDoc ids)
278         throws TorqueException
279     {
280         return PortletDbEntryPeer.retrieveByPKs(ids);
281     }
282 }
283
Popular Tags