View Javadoc

1   
2   
3   package org.apache.jetspeed.om.dbpsml;
4   
5   import java.math.BigDecimal;
6   import java.util.Date;
7   import java.util.List;
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 JetspeedRoleProfile objects.
21   * This class was autogenerated by Torque on:
22   *
23   * [Thu Apr 22 23:12:36 EDT 2004]
24   *
25    *
26   * You should not use this class directly.  It should not even be
27   * extended all references should be to JetspeedRoleProfileManager
28   */
29  public abstract class BaseJetspeedRoleProfileManager
30      extends AbstractBaseManager
31  {
32      /*** The name of the manager */
33      protected static String MANAGED_CLASS = "org.apache.jetspeed.om.dbpsml.JetspeedRoleProfile";
34  
35      /*** The name of our class to pass to Torque as the default manager. */
36      protected static String DEFAULT_MANAGER_CLASS
37          = "org.apache.jetspeed.om.dbpsml.JetspeedRoleProfileManager";
38  
39      /***
40       * Retrieves an implementation of the manager, based on the settings in
41       * the configuration.
42       *
43       * @return an implementation of JetspeedRoleProfileManager.
44       */
45      public static JetspeedRoleProfileManager getManager()
46      {
47          return (JetspeedRoleProfileManager)
48              Torque.getManager(JetspeedRoleProfileManager.MANAGED_CLASS,
49                  JetspeedRoleProfileManager.DEFAULT_MANAGER_CLASS);
50      }
51  
52      /***
53       * Static accessor for the @see #getInstanceImpl().
54       *
55       * @return a <code>JetspeedRoleProfile</code> value
56       * @exception TorqueException if an error occurs
57       */
58      public static JetspeedRoleProfile 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>JetspeedRoleProfile</code> value
69       * @exception TorqueException if an error occurs
70       */
71      public static JetspeedRoleProfile 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>JetspeedRoleProfile</code> value
82       * @exception TorqueException if an error occurs
83       */
84      public static JetspeedRoleProfile 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>JetspeedRoleProfile</code> value
95       * @exception TorqueException if an error occurs
96       */
97      public static JetspeedRoleProfile getInstance(int 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>JetspeedRoleProfile</code> value
108      * @exception TorqueException if an error occurs
109      */
110     public static JetspeedRoleProfile getInstance(int 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 getInstances(List 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 getInstances(List 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(JetspeedRoleProfile 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>BaseJetspeedRoleProfileManager</code> instance.
172      *
173      * @exception TorqueException if an error occurs
174      */
175     public BaseJetspeedRoleProfileManager()
176         throws TorqueException
177     {
178         setClassName("org.apache.jetspeed.om.dbpsml.JetspeedRoleProfile");
179     }
180 
181     /***
182      * Get a fresh instance of a JetspeedRoleProfileManager
183      */
184     protected JetspeedRoleProfile getInstanceImpl()
185         throws TorqueException
186     {
187         JetspeedRoleProfile obj = null;
188         try
189         {
190             obj = (JetspeedRoleProfile) getOMInstance();
191         }
192         catch (Exception e)
193         {
194             throw new TorqueException(e);
195         }
196         return obj;
197     }
198 
199 
200     /***
201      * Get a JetspeedRoleProfile with the given id.
202      *
203      * @param id <code>ObjectKey</code> value
204      */
205     protected JetspeedRoleProfile getInstanceImpl(ObjectKey id)
206         throws TorqueException
207     {
208         return (JetspeedRoleProfile) getOMInstance(id);
209     }
210 
211     /***
212      * Get a JetspeedRoleProfile with the given id.
213      *
214      * @param id <code>ObjectKey</code> value
215      * @param fromCache if true, look for cached JetspeedRoleProfiles before loading
216      * from storage.
217      */
218     protected JetspeedRoleProfile getInstanceImpl(ObjectKey id, boolean fromCache)
219         throws TorqueException
220     {
221         return (JetspeedRoleProfile) getOMInstance(id, fromCache);
222     }
223 
224     /***
225      * Gets a list of JetspeedRoleProfiles based on id's.
226      *
227      * @param ids a List of <code>ObjectKeys</code> value
228      * @return a <code>List</code> of JetspeedRoleProfiles
229      * @exception TorqueException if an error occurs
230      */
231     protected List getInstancesImpl(List ids)
232         throws TorqueException
233     {
234         return getOMs(ids);
235     }
236 
237     /***
238      * Gets a list of JetspeedRoleProfiles based on id's.
239      *
240      * @param ids a List of <code>ObjectKeys</code> value
241      * @param fromCache if true, look for cached JetspeedRoleProfiles before loading
242      * from storage.
243      * @return a <code>List</code> of JetspeedRoleProfiles
244      * @exception TorqueException if an error occurs
245      */
246     protected List getInstancesImpl(List 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(JetspeedRoleProfile om)
256         throws TorqueException
257     {
258         Criteria crit = JetspeedRoleProfilePeer
259             .buildCriteria((JetspeedRoleProfile)om);
260         return JetspeedRoleProfilePeer.doSelect(crit).size() > 0;
261     }
262 
263 
264     protected Persistent retrieveStoredOM(ObjectKey id)
265         throws TorqueException
266     {
267         return JetspeedRoleProfilePeer.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 retrieveStoredOMs(List ids)
278         throws TorqueException
279     {
280         return JetspeedRoleProfilePeer.retrieveByPKs(ids);
281     }
282 }