KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.tigris.scarab.om;
2
3 import java.math.BigDecimal JavaDoc;
4 import java.sql.Connection JavaDoc;
5 import java.sql.SQLException JavaDoc;
6 import java.util.ArrayList JavaDoc;
7 import java.util.Date JavaDoc;
8 import java.util.Iterator JavaDoc;
9 import java.util.LinkedList JavaDoc;
10 import java.util.List JavaDoc;
11
12 import org.apache.torque.NoRowsException;
13 import org.apache.torque.TooManyRowsException;
14 import org.apache.torque.Torque;
15 import org.apache.torque.TorqueException;
16 import org.apache.torque.map.MapBuilder;
17 import org.apache.torque.map.TableMap;
18 import org.apache.torque.om.DateKey;
19 import org.apache.torque.om.NumberKey;
20 import org.apache.torque.om.StringKey;
21 import org.apache.torque.om.ObjectKey;
22 import org.apache.torque.om.SimpleKey;
23 import org.apache.torque.util.BasePeer;
24 import org.apache.torque.util.Criteria;
25
26 import com.workingdogs.village.DataSetException;
27 import com.workingdogs.village.QueryDataSet;
28 import com.workingdogs.village.Record;
29
30 // Local classes
31
import org.tigris.scarab.om.map.*;
32
33
34   
35   
36   
37   
38   
39 /**
40  */

41 public abstract class BaseRModuleUserAttributePeer
42     extends BasePeer
43 {
44
45     /** the default database name for this class */
46     public static final String JavaDoc DATABASE_NAME = "scarab";
47
48      /** the table name for this class */
49     public static final String JavaDoc TABLE_NAME = "SCARAB_R_MODULE_USER_ATTRIBUTE";
50
51     /**
52      * @return the map builder for this peer
53      * @throws TorqueException Any exceptions caught during processing will be
54      * rethrown wrapped into a TorqueException.
55      */

56     public static MapBuilder getMapBuilder()
57         throws TorqueException
58     {
59         return getMapBuilder(RModuleUserAttributeMapBuilder.CLASS_NAME);
60     }
61
62       /** the column name for the RMUA_ID field */
63     public static final String JavaDoc RMUA_ID;
64       /** the column name for the LIST_ID field */
65     public static final String JavaDoc LIST_ID;
66       /** the column name for the MODULE_ID field */
67     public static final String JavaDoc MODULE_ID;
68       /** the column name for the USER_ID field */
69     public static final String JavaDoc USER_ID;
70       /** the column name for the ISSUE_TYPE_ID field */
71     public static final String JavaDoc ISSUE_TYPE_ID;
72       /** the column name for the ATTRIBUTE_ID field */
73     public static final String JavaDoc ATTRIBUTE_ID;
74       /** the column name for the PREFERRED_ORDER field */
75     public static final String JavaDoc PREFERRED_ORDER;
76   
77     static
78     {
79           RMUA_ID = "SCARAB_R_MODULE_USER_ATTRIBUTE.RMUA_ID";
80           LIST_ID = "SCARAB_R_MODULE_USER_ATTRIBUTE.LIST_ID";
81           MODULE_ID = "SCARAB_R_MODULE_USER_ATTRIBUTE.MODULE_ID";
82           USER_ID = "SCARAB_R_MODULE_USER_ATTRIBUTE.USER_ID";
83           ISSUE_TYPE_ID = "SCARAB_R_MODULE_USER_ATTRIBUTE.ISSUE_TYPE_ID";
84           ATTRIBUTE_ID = "SCARAB_R_MODULE_USER_ATTRIBUTE.ATTRIBUTE_ID";
85           PREFERRED_ORDER = "SCARAB_R_MODULE_USER_ATTRIBUTE.PREFERRED_ORDER";
86           if (Torque.isInit())
87         {
88             try
89             {
90                 getMapBuilder(RModuleUserAttributeMapBuilder.CLASS_NAME);
91             }
92             catch (Exception JavaDoc e)
93             {
94                 log.error("Could not initialize Peer", e);
95             }
96         }
97         else
98         {
99             Torque.registerMapBuilder(RModuleUserAttributeMapBuilder.CLASS_NAME);
100         }
101     }
102  
103     /** number of columns for this peer */
104     public static final int numColumns = 7;
105
106     /** A class that can be returned by this peer. */
107     protected static final String JavaDoc CLASSNAME_DEFAULT =
108         "org.tigris.scarab.om.RModuleUserAttribute";
109
110     /** A class that can be returned by this peer. */
111     protected static final Class JavaDoc CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
112
113     /**
114      * Class object initialization method.
115      *
116      * @param className name of the class to initialize
117      * @return the initialized class
118      */

119     private static Class JavaDoc initClass(String JavaDoc className)
120     {
121         Class JavaDoc c = null;
122         try
123         {
124             c = Class.forName(className);
125         }
126         catch (Throwable JavaDoc t)
127         {
128             log.error("A FATAL ERROR has occurred which should not "
129                 + "have happened under any circumstance. Please notify "
130                 + "the Torque developers <torque-dev@db.apache.org> "
131                 + "and give as many details as possible (including the error "
132                 + "stack trace).", t);
133
134             // Error objects should always be propogated.
135
if (t instanceof Error JavaDoc)
136             {
137                 throw (Error JavaDoc) t.fillInStackTrace();
138             }
139         }
140         return c;
141     }
142
143     /**
144      * Get the list of objects for a ResultSet. Please not that your
145      * resultset MUST return columns in the right order. You can use
146      * getFieldNames() in BaseObject to get the correct sequence.
147      *
148      * @param results the ResultSet
149      * @return the list of objects
150      * @throws TorqueException Any exceptions caught during processing will be
151      * rethrown wrapped into a TorqueException.
152      */

153     public static List JavaDoc resultSet2Objects(java.sql.ResultSet JavaDoc results)
154             throws TorqueException
155     {
156         try
157         {
158             QueryDataSet qds = null;
159             List JavaDoc rows = null;
160             try
161             {
162                 qds = new QueryDataSet(results);
163                 rows = getSelectResults(qds);
164             }
165             finally
166             {
167                 if (qds != null)
168                 {
169                     qds.close();
170                 }
171             }
172
173             return populateObjects(rows);
174         }
175         catch (SQLException JavaDoc e)
176         {
177             throw new TorqueException(e);
178         }
179         catch (DataSetException e)
180         {
181             throw new TorqueException(e);
182         }
183     }
184
185
186   
187     /**
188      * Method to do inserts.
189      *
190      * @param criteria object used to create the INSERT statement.
191      * @throws TorqueException Any exceptions caught during processing will be
192      * rethrown wrapped into a TorqueException.
193      */

194     public static ObjectKey doInsert(Criteria criteria)
195         throws TorqueException
196     {
197         return BaseRModuleUserAttributePeer
198             .doInsert(criteria, (Connection JavaDoc) null);
199     }
200
201     /**
202      * Method to do inserts. This method is to be used during a transaction,
203      * otherwise use the doInsert(Criteria) method. It will take care of
204      * the connection details internally.
205      *
206      * @param criteria object used to create the INSERT statement.
207      * @param con the connection to use
208      * @throws TorqueException Any exceptions caught during processing will be
209      * rethrown wrapped into a TorqueException.
210      */

211     public static ObjectKey doInsert(Criteria criteria, Connection JavaDoc con)
212         throws TorqueException
213     {
214                                             
215         setDbName(criteria);
216
217         if (con == null)
218         {
219             return BasePeer.doInsert(criteria);
220         }
221         else
222         {
223             return BasePeer.doInsert(criteria, con);
224         }
225     }
226
227     /**
228      * Add all the columns needed to create a new object.
229      *
230      * @param criteria object containing the columns to add.
231      * @throws TorqueException Any exceptions caught during processing will be
232      * rethrown wrapped into a TorqueException.
233      */

234     public static void addSelectColumns(Criteria criteria)
235             throws TorqueException
236     {
237           criteria.addSelectColumn(RMUA_ID);
238           criteria.addSelectColumn(LIST_ID);
239           criteria.addSelectColumn(MODULE_ID);
240           criteria.addSelectColumn(USER_ID);
241           criteria.addSelectColumn(ISSUE_TYPE_ID);
242           criteria.addSelectColumn(ATTRIBUTE_ID);
243           criteria.addSelectColumn(PREFERRED_ORDER);
244       }
245
246     /**
247      * Create a new object of type cls from a resultset row starting
248      * from a specified offset. This is done so that you can select
249      * other rows than just those needed for this object. You may
250      * for example want to create two objects from the same row.
251      *
252      * @throws TorqueException Any exceptions caught during processing will be
253      * rethrown wrapped into a TorqueException.
254      */

255     public static RModuleUserAttribute row2Object(Record row,
256                                              int offset,
257                                              Class JavaDoc cls)
258         throws TorqueException
259     {
260         try
261         {
262             RModuleUserAttribute obj = (RModuleUserAttribute) cls.newInstance();
263             RModuleUserAttributePeer.populateObject(row, offset, obj);
264                   obj.setModified(false);
265               obj.setNew(false);
266
267             return obj;
268         }
269         catch (InstantiationException JavaDoc e)
270         {
271             throw new TorqueException(e);
272         }
273         catch (IllegalAccessException JavaDoc e)
274         {
275             throw new TorqueException(e);
276         }
277     }
278
279     /**
280      * Populates an object from a resultset row starting
281      * from a specified offset. This is done so that you can select
282      * other rows than just those needed for this object. You may
283      * for example want to create two objects from the same row.
284      *
285      * @throws TorqueException Any exceptions caught during processing will be
286      * rethrown wrapped into a TorqueException.
287      */

288     public static void populateObject(Record row,
289                                       int offset,
290                                       RModuleUserAttribute obj)
291         throws TorqueException
292     {
293         try
294         {
295                 obj.setRmuaId(row.getValue(offset + 0).asLongObj());
296                   obj.setListId(row.getValue(offset + 1).asLongObj());
297                   obj.setModuleId(row.getValue(offset + 2).asIntegerObj());
298                   obj.setUserId(row.getValue(offset + 3).asIntegerObj());
299                   obj.setIssueTypeId(row.getValue(offset + 4).asIntegerObj());
300                   obj.setAttributeId(row.getValue(offset + 5).asIntegerObj());
301                   obj.setOrder(row.getValue(offset + 6).asInt());
302               }
303         catch (DataSetException e)
304         {
305             throw new TorqueException(e);
306         }
307     }
308
309     /**
310      * Method to do selects.
311      *
312      * @param criteria object used to create the SELECT statement.
313      * @return List of selected Objects
314      * @throws TorqueException Any exceptions caught during processing will be
315      * rethrown wrapped into a TorqueException.
316      */

317     public static List JavaDoc doSelect(Criteria criteria) throws TorqueException
318     {
319         return populateObjects(doSelectVillageRecords(criteria));
320     }
321
322     /**
323      * Method to do selects within a transaction.
324      *
325      * @param criteria object used to create the SELECT statement.
326      * @param con the connection to use
327      * @return List of selected Objects
328      * @throws TorqueException Any exceptions caught during processing will be
329      * rethrown wrapped into a TorqueException.
330      */

331     public static List JavaDoc doSelect(Criteria criteria, Connection JavaDoc con)
332         throws TorqueException
333     {
334         return populateObjects(doSelectVillageRecords(criteria, con));
335     }
336
337     /**
338      * Grabs the raw Village records to be formed into objects.
339      * This method handles connections internally. The Record objects
340      * returned by this method should be considered readonly. Do not
341      * alter the data and call save(), your results may vary, but are
342      * certainly likely to result in hard to track MT bugs.
343      *
344      * @throws TorqueException Any exceptions caught during processing will be
345      * rethrown wrapped into a TorqueException.
346      */

347     public static List JavaDoc doSelectVillageRecords(Criteria criteria)
348         throws TorqueException
349     {
350         return BaseRModuleUserAttributePeer
351             .doSelectVillageRecords(criteria, (Connection JavaDoc) null);
352     }
353
354     /**
355      * Grabs the raw Village records to be formed into objects.
356      * This method should be used for transactions
357      *
358      * @param criteria object used to create the SELECT statement.
359      * @param con the connection to use
360      * @throws TorqueException Any exceptions caught during processing will be
361      * rethrown wrapped into a TorqueException.
362      */

363     public static List JavaDoc doSelectVillageRecords(Criteria criteria, Connection JavaDoc con)
364         throws TorqueException
365     {
366         if (criteria.getSelectColumns().size() == 0)
367         {
368             addSelectColumns(criteria);
369         }
370
371                                             
372         setDbName(criteria);
373
374         // BasePeer returns a List of Value (Village) arrays. The array
375
// order follows the order columns were placed in the Select clause.
376
if (con == null)
377         {
378             return BasePeer.doSelect(criteria);
379         }
380         else
381         {
382             return BasePeer.doSelect(criteria, con);
383         }
384     }
385
386     /**
387      * The returned List will contain objects of the default type or
388      * objects that inherit from the default.
389      *
390      * @throws TorqueException Any exceptions caught during processing will be
391      * rethrown wrapped into a TorqueException.
392      */

393     public static List JavaDoc populateObjects(List JavaDoc records)
394         throws TorqueException
395     {
396         List JavaDoc results = new ArrayList JavaDoc(records.size());
397
398         // populate the object(s)
399
for (int i = 0; i < records.size(); i++)
400         {
401             Record row = (Record) records.get(i);
402               results.add(RModuleUserAttributePeer.row2Object(row, 1,
403                 RModuleUserAttributePeer.getOMClass()));
404           }
405         return results;
406     }
407  
408
409     /**
410      * The class that the Peer will make instances of.
411      * If the BO is abstract then you must implement this method
412      * in the BO.
413      *
414      * @throws TorqueException Any exceptions caught during processing will be
415      * rethrown wrapped into a TorqueException.
416      */

417     public static Class JavaDoc getOMClass()
418         throws TorqueException
419     {
420         return CLASS_DEFAULT;
421     }
422
423     /**
424      * Method to do updates.
425      *
426      * @param criteria object containing data that is used to create the UPDATE
427      * statement.
428      * @throws TorqueException Any exceptions caught during processing will be
429      * rethrown wrapped into a TorqueException.
430      */

431     public static void doUpdate(Criteria criteria) throws TorqueException
432     {
433          BaseRModuleUserAttributePeer
434             .doUpdate(criteria, (Connection JavaDoc) null);
435     }
436
437     /**
438      * Method to do updates. This method is to be used during a transaction,
439      * otherwise use the doUpdate(Criteria) method. It will take care of
440      * the connection details internally.
441      *
442      * @param criteria object containing data that is used to create the UPDATE
443      * statement.
444      * @param con the connection to use
445      * @throws TorqueException Any exceptions caught during processing will be
446      * rethrown wrapped into a TorqueException.
447      */

448     public static void doUpdate(Criteria criteria, Connection JavaDoc con)
449         throws TorqueException
450     {
451         Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
452                    selectCriteria.put(RMUA_ID, criteria.remove(RMUA_ID));
453                                                                   
454         setDbName(criteria);
455
456         if (con == null)
457         {
458             BasePeer.doUpdate(selectCriteria, criteria);
459         }
460         else
461         {
462             BasePeer.doUpdate(selectCriteria, criteria, con);
463         }
464     }
465
466     /**
467      * Method to do deletes.
468      *
469      * @param criteria object containing data that is used DELETE from database.
470      * @throws TorqueException Any exceptions caught during processing will be
471      * rethrown wrapped into a TorqueException.
472      */

473      public static void doDelete(Criteria criteria) throws TorqueException
474      {
475          RModuleUserAttributePeer
476             .doDelete(criteria, (Connection JavaDoc) null);
477      }
478
479     /**
480      * Method to do deletes. This method is to be used during a transaction,
481      * otherwise use the doDelete(Criteria) method. It will take care of
482      * the connection details internally.
483      *
484      * @param criteria object containing data that is used DELETE from database.
485      * @param con the connection to use
486      * @throws TorqueException Any exceptions caught during processing will be
487      * rethrown wrapped into a TorqueException.
488      */

489      public static void doDelete(Criteria criteria, Connection JavaDoc con)
490         throws TorqueException
491      {
492                                             
493         setDbName(criteria);
494
495         if (con == null)
496         {
497             BasePeer.doDelete(criteria);
498         }
499         else
500         {
501             BasePeer.doDelete(criteria, con);
502         }
503      }
504
505     /**
506      * Method to do selects
507      *
508      * @throws TorqueException Any exceptions caught during processing will be
509      * rethrown wrapped into a TorqueException.
510      */

511     public static List JavaDoc doSelect(RModuleUserAttribute obj) throws TorqueException
512     {
513         return doSelect(buildSelectCriteria(obj));
514     }
515
516     /**
517      * Method to do inserts
518      *
519      * @throws TorqueException Any exceptions caught during processing will be
520      * rethrown wrapped into a TorqueException.
521      */

522     public static void doInsert(RModuleUserAttribute obj) throws TorqueException
523     {
524           obj.setPrimaryKey(doInsert(buildCriteria(obj)));
525           obj.setNew(false);
526         obj.setModified(false);
527     }
528
529     /**
530      * @param obj the data object to update in the database.
531      * @throws TorqueException Any exceptions caught during processing will be
532      * rethrown wrapped into a TorqueException.
533      */

534     public static void doUpdate(RModuleUserAttribute obj) throws TorqueException
535     {
536         doUpdate(buildCriteria(obj));
537         obj.setModified(false);
538     }
539
540     /**
541      * @param obj the data object to delete in the database.
542      * @throws TorqueException Any exceptions caught during processing will be
543      * rethrown wrapped into a TorqueException.
544      */

545     public static void doDelete(RModuleUserAttribute obj) throws TorqueException
546     {
547         doDelete(buildSelectCriteria(obj));
548     }
549
550     /**
551      * Method to do inserts. This method is to be used during a transaction,
552      * otherwise use the doInsert(RModuleUserAttribute) method. It will take
553      * care of the connection details internally.
554      *
555      * @param obj the data object to insert into the database.
556      * @param con the connection to use
557      * @throws TorqueException Any exceptions caught during processing will be
558      * rethrown wrapped into a TorqueException.
559      */

560     public static void doInsert(RModuleUserAttribute obj, Connection JavaDoc con)
561         throws TorqueException
562     {
563           obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
564           obj.setNew(false);
565         obj.setModified(false);
566     }
567
568     /**
569      * Method to do update. This method is to be used during a transaction,
570      * otherwise use the doUpdate(RModuleUserAttribute) method. It will take
571      * care of the connection details internally.
572      *
573      * @param obj the data object to update in the database.
574      * @param con the connection to use
575      * @throws TorqueException Any exceptions caught during processing will be
576      * rethrown wrapped into a TorqueException.
577      */

578     public static void doUpdate(RModuleUserAttribute obj, Connection JavaDoc con)
579         throws TorqueException
580     {
581         doUpdate(buildCriteria(obj), con);
582         obj.setModified(false);
583     }
584
585     /**
586      * Method to delete. This method is to be used during a transaction,
587      * otherwise use the doDelete(RModuleUserAttribute) method. It will take
588      * care of the connection details internally.
589      *
590      * @param obj the data object to delete in the database.
591      * @param con the connection to use
592      * @throws TorqueException Any exceptions caught during processing will be
593      * rethrown wrapped into a TorqueException.
594      */

595     public static void doDelete(RModuleUserAttribute obj, Connection JavaDoc con)
596         throws TorqueException
597     {
598         doDelete(buildSelectCriteria(obj), con);
599     }
600
601     /**
602      * Method to do deletes.
603      *
604      * @param pk ObjectKey that is used DELETE from database.
605      * @throws TorqueException Any exceptions caught during processing will be
606      * rethrown wrapped into a TorqueException.
607      */

608     public static void doDelete(ObjectKey pk) throws TorqueException
609     {
610         BaseRModuleUserAttributePeer
611            .doDelete(pk, (Connection JavaDoc) null);
612     }
613
614     /**
615      * Method to delete. This method is to be used during a transaction,
616      * otherwise use the doDelete(ObjectKey) method. It will take
617      * care of the connection details internally.
618      *
619      * @param pk the primary key for the object to delete in the database.
620      * @param con the connection to use
621      * @throws TorqueException Any exceptions caught during processing will be
622      * rethrown wrapped into a TorqueException.
623      */

624     public static void doDelete(ObjectKey pk, Connection JavaDoc con)
625         throws TorqueException
626     {
627         doDelete(buildCriteria(pk), con);
628     }
629
630     /** Build a Criteria object from an ObjectKey */
631     public static Criteria buildCriteria( ObjectKey pk )
632     {
633         Criteria criteria = new Criteria();
634               criteria.add(RMUA_ID, pk);
635           return criteria;
636      }
637
638     /** Build a Criteria object from the data object for this peer */
639     public static Criteria buildCriteria( RModuleUserAttribute obj )
640     {
641         Criteria criteria = new Criteria(DATABASE_NAME);
642               if (!obj.isNew())
643             criteria.add(RMUA_ID, obj.getRmuaId());
644               criteria.add(LIST_ID, obj.getListId());
645               criteria.add(MODULE_ID, obj.getModuleId());
646               criteria.add(USER_ID, obj.getUserId());
647               criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId());
648               criteria.add(ATTRIBUTE_ID, obj.getAttributeId());
649               criteria.add(PREFERRED_ORDER, obj.getOrder());
650           return criteria;
651     }
652
653     /** Build a Criteria object from the data object for this peer, skipping all binary columns */
654     public static Criteria buildSelectCriteria( RModuleUserAttribute obj )
655     {
656         Criteria criteria = new Criteria(DATABASE_NAME);
657               if (!obj.isNew())
658                     criteria.add(RMUA_ID, obj.getRmuaId());
659                           criteria.add(LIST_ID, obj.getListId());
660                           criteria.add(MODULE_ID, obj.getModuleId());
661                           criteria.add(USER_ID, obj.getUserId());
662                           criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId());
663                           criteria.add(ATTRIBUTE_ID, obj.getAttributeId());
664                           criteria.add(PREFERRED_ORDER, obj.getOrder());
665               return criteria;
666     }
667  
668     
669         /**
670      * Retrieve a single object by pk
671      *
672      * @param pk the primary key
673      * @throws TorqueException Any exceptions caught during processing will be
674      * rethrown wrapped into a TorqueException.
675      * @throws NoRowsException Primary key was not found in database.
676      * @throws TooManyRowsException Primary key was not found in database.
677      */

678     public static RModuleUserAttribute retrieveByPK(Long JavaDoc pk)
679         throws TorqueException, NoRowsException, TooManyRowsException
680     {
681         return retrieveByPK(SimpleKey.keyFor(pk));
682     }
683
684     /**
685      * Retrieve a single object by pk
686      *
687      * @param pk the primary key
688      * @param con the connection to use
689      * @throws TorqueException Any exceptions caught during processing will be
690      * rethrown wrapped into a TorqueException.
691      * @throws NoRowsException Primary key was not found in database.
692      * @throws TooManyRowsException Primary key was not found in database.
693      */

694     public static RModuleUserAttribute retrieveByPK(Long JavaDoc pk, Connection JavaDoc con)
695         throws TorqueException, NoRowsException, TooManyRowsException
696     {
697         return retrieveByPK(SimpleKey.keyFor(pk), con);
698     }
699   
700     /**
701      * Retrieve a single object by pk
702      *
703      * @param pk the primary key
704      * @throws TorqueException Any exceptions caught during processing will be
705      * rethrown wrapped into a TorqueException.
706      * @throws NoRowsException Primary key was not found in database.
707      * @throws TooManyRowsException Primary key was not found in database.
708      */

709     public static RModuleUserAttribute retrieveByPK(ObjectKey pk)
710         throws TorqueException, NoRowsException, TooManyRowsException
711     {
712         Connection JavaDoc db = null;
713         RModuleUserAttribute retVal = null;
714         try
715         {
716             db = Torque.getConnection(DATABASE_NAME);
717             retVal = retrieveByPK(pk, db);
718         }
719         finally
720         {
721             Torque.closeConnection(db);
722         }
723         return(retVal);
724     }
725
726     /**
727      * Retrieve a single object by pk
728      *
729      * @param pk the primary key
730      * @param con the connection to use
731      * @throws TorqueException Any exceptions caught during processing will be
732      * rethrown wrapped into a TorqueException.
733      * @throws NoRowsException Primary key was not found in database.
734      * @throws TooManyRowsException Primary key was not found in database.
735      */

736     public static RModuleUserAttribute retrieveByPK(ObjectKey pk, Connection JavaDoc con)
737         throws TorqueException, NoRowsException, TooManyRowsException
738     {
739         Criteria criteria = buildCriteria(pk);
740         List JavaDoc v = doSelect(criteria, con);
741         if (v.size() == 0)
742         {
743             throw new NoRowsException("Failed to select a row.");
744         }
745         else if (v.size() > 1)
746         {
747             throw new TooManyRowsException("Failed to select only one row.");
748         }
749         else
750         {
751             return (RModuleUserAttribute)v.get(0);
752         }
753     }
754
755     /**
756      * Retrieve a multiple objects by pk
757      *
758      * @param pks List of primary keys
759      * @throws TorqueException Any exceptions caught during processing will be
760      * rethrown wrapped into a TorqueException.
761      */

762     public static List JavaDoc retrieveByPKs(List JavaDoc pks)
763         throws TorqueException
764     {
765         Connection JavaDoc db = null;
766         List JavaDoc retVal = null;
767         try
768         {
769            db = Torque.getConnection(DATABASE_NAME);
770            retVal = retrieveByPKs(pks, db);
771         }
772         finally
773         {
774             Torque.closeConnection(db);
775         }
776         return(retVal);
777     }
778
779     /**
780      * Retrieve a multiple objects by pk
781      *
782      * @param pks List of primary keys
783      * @param dbcon the connection to use
784      * @throws TorqueException Any exceptions caught during processing will be
785      * rethrown wrapped into a TorqueException.
786      */

787     public static List JavaDoc retrieveByPKs( List JavaDoc pks, Connection JavaDoc dbcon )
788         throws TorqueException
789     {
790         List JavaDoc objs = null;
791         if (pks == null || pks.size() == 0)
792         {
793             objs = new LinkedList JavaDoc();
794         }
795         else
796         {
797             Criteria criteria = new Criteria();
798               criteria.addIn( RMUA_ID, pks );
799           objs = doSelect(criteria, dbcon);
800         }
801         return objs;
802     }
803
804  
805
806
807
808                   
809                                               
810                 
811                 
812
813     /**
814      * selects a collection of RModuleUserAttribute objects pre-filled with their
815      * MITList objects.
816      *
817      * This method is protected by default in order to keep the public
818      * api reasonable. You can provide public methods for those you
819      * actually need in RModuleUserAttributePeer.
820      *
821      * @throws TorqueException Any exceptions caught during processing will be
822      * rethrown wrapped into a TorqueException.
823      */

824     protected static List JavaDoc doSelectJoinMITList(Criteria criteria)
825         throws TorqueException
826     {
827         setDbName(criteria);
828
829         RModuleUserAttributePeer.addSelectColumns(criteria);
830         int offset = numColumns + 1;
831         MITListPeer.addSelectColumns(criteria);
832
833
834                         criteria.addJoin(RModuleUserAttributePeer.LIST_ID,
835             MITListPeer.LIST_ID);
836         
837
838                                                                                                                                       
839         List JavaDoc rows = BasePeer.doSelect(criteria);
840         List JavaDoc results = new ArrayList JavaDoc();
841
842         for (int i = 0; i < rows.size(); i++)
843         {
844             Record row = (Record) rows.get(i);
845
846                             Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
847                     RModuleUserAttribute obj1 = (RModuleUserAttribute) RModuleUserAttributePeer
848                 .row2Object(row, 1, omClass);
849                      omClass = MITListPeer.getOMClass();
850                     MITList obj2 = (MITList)MITListPeer
851                 .row2Object(row, offset, omClass);
852
853             boolean newObject = true;
854             for (int j = 0; j < results.size(); j++)
855             {
856                 RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
857                 MITList temp_obj2 = (MITList)temp_obj1.getMITList();
858                 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
859                 {
860                     newObject = false;
861                               temp_obj2.addRModuleUserAttribute(obj1);
862                               break;
863                 }
864             }
865                       if (newObject)
866             {
867                 obj2.initRModuleUserAttributes();
868                 obj2.addRModuleUserAttribute(obj1);
869             }
870                       results.add(obj1);
871         }
872         return results;
873     }
874                                                             
875                         
876                 
877
878     /**
879      * selects a collection of RModuleUserAttribute objects pre-filled with their
880      * ScarabModule objects.
881      *
882      * This method is protected by default in order to keep the public
883      * api reasonable. You can provide public methods for those you
884      * actually need in RModuleUserAttributePeer.
885      *
886      * @throws TorqueException Any exceptions caught during processing will be
887      * rethrown wrapped into a TorqueException.
888      */

889     protected static List JavaDoc doSelectJoinScarabModule(Criteria criteria)
890         throws TorqueException
891     {
892         setDbName(criteria);
893
894         RModuleUserAttributePeer.addSelectColumns(criteria);
895         int offset = numColumns + 1;
896         ScarabModulePeer.addSelectColumns(criteria);
897
898
899                         criteria.addJoin(RModuleUserAttributePeer.MODULE_ID,
900             ScarabModulePeer.MODULE_ID);
901         
902
903                                                                                                                                       
904         List JavaDoc rows = BasePeer.doSelect(criteria);
905         List JavaDoc results = new ArrayList JavaDoc();
906
907         for (int i = 0; i < rows.size(); i++)
908         {
909             Record row = (Record) rows.get(i);
910
911                             Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
912                     RModuleUserAttribute obj1 = (RModuleUserAttribute) RModuleUserAttributePeer
913                 .row2Object(row, 1, omClass);
914                      omClass = ScarabModulePeer.getOMClass(row, offset);
915                     ScarabModule obj2 = (ScarabModule)ScarabModulePeer
916                 .row2Object(row, offset, omClass);
917
918             boolean newObject = true;
919             for (int j = 0; j < results.size(); j++)
920             {
921                 RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
922                 ScarabModule temp_obj2 = (ScarabModule)temp_obj1.getModule();
923                 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
924                 {
925                     newObject = false;
926                               temp_obj2.addRModuleUserAttribute(obj1);
927                               break;
928                 }
929             }
930                       if (newObject)
931             {
932                 obj2.initRModuleUserAttributes();
933                 obj2.addRModuleUserAttribute(obj1);
934             }
935                       results.add(obj1);
936         }
937         return results;
938     }
939                                                             
940                         
941                 
942
943     /**
944      * selects a collection of RModuleUserAttribute objects pre-filled with their
945      * ScarabUserImpl objects.
946      *
947      * This method is protected by default in order to keep the public
948      * api reasonable. You can provide public methods for those you
949      * actually need in RModuleUserAttributePeer.
950      *
951      * @throws TorqueException Any exceptions caught during processing will be
952      * rethrown wrapped into a TorqueException.
953      */

954     protected static List JavaDoc doSelectJoinScarabUserImpl(Criteria criteria)
955         throws TorqueException
956     {
957         setDbName(criteria);
958
959         RModuleUserAttributePeer.addSelectColumns(criteria);
960         int offset = numColumns + 1;
961         ScarabUserImplPeer.addSelectColumns(criteria);
962
963
964                         criteria.addJoin(RModuleUserAttributePeer.USER_ID,
965             ScarabUserImplPeer.USER_ID);
966         
967
968                                                                                                                                       
969         List JavaDoc rows = BasePeer.doSelect(criteria);
970         List JavaDoc results = new ArrayList JavaDoc();
971
972         for (int i = 0; i < rows.size(); i++)
973         {
974             Record row = (Record) rows.get(i);
975
976                             Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
977                     RModuleUserAttribute obj1 = (RModuleUserAttribute) RModuleUserAttributePeer
978                 .row2Object(row, 1, omClass);
979                      omClass = ScarabUserImplPeer.getOMClass();
980                     ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
981                 .row2Object(row, offset, omClass);
982
983             boolean newObject = true;
984             for (int j = 0; j < results.size(); j++)
985             {
986                 RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
987                 ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser();
988                 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
989                 {
990                     newObject = false;
991                               temp_obj2.addRModuleUserAttribute(obj1);
992                               break;
993                 }
994             }
995                       if (newObject)
996             {
997                 obj2.initRModuleUserAttributes();
998                 obj2.addRModuleUserAttribute(obj1);
999             }
1000                      results.add(obj1);
1001        }
1002        return results;
1003    }
1004                                                            
1005                
1006                
1007
1008    /**
1009     * selects a collection of RModuleUserAttribute objects pre-filled with their
1010     * IssueType objects.
1011     *
1012     * This method is protected by default in order to keep the public
1013     * api reasonable. You can provide public methods for those you
1014     * actually need in RModuleUserAttributePeer.
1015     *
1016     * @throws TorqueException Any exceptions caught during processing will be
1017     * rethrown wrapped into a TorqueException.
1018     */

1019    protected static List JavaDoc doSelectJoinIssueType(Criteria criteria)
1020        throws TorqueException
1021    {
1022        setDbName(criteria);
1023
1024        RModuleUserAttributePeer.addSelectColumns(criteria);
1025        int offset = numColumns + 1;
1026        IssueTypePeer.addSelectColumns(criteria);
1027
1028
1029                        criteria.addJoin(RModuleUserAttributePeer.ISSUE_TYPE_ID,
1030            IssueTypePeer.ISSUE_TYPE_ID);
1031        
1032
1033                                                                                                                                      
1034        List JavaDoc rows = BasePeer.doSelect(criteria);
1035        List JavaDoc results = new ArrayList JavaDoc();
1036
1037        for (int i = 0; i < rows.size(); i++)
1038        {
1039            Record row = (Record) rows.get(i);
1040
1041                            Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
1042                    RModuleUserAttribute obj1 = (RModuleUserAttribute) RModuleUserAttributePeer
1043                .row2Object(row, 1, omClass);
1044                     omClass = IssueTypePeer.getOMClass();
1045                    IssueType obj2 = (IssueType)IssueTypePeer
1046                .row2Object(row, offset, omClass);
1047
1048            boolean newObject = true;
1049            for (int j = 0; j < results.size(); j++)
1050            {
1051                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1052                IssueType temp_obj2 = (IssueType)temp_obj1.getIssueType();
1053                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1054                {
1055                    newObject = false;
1056                              temp_obj2.addRModuleUserAttribute(obj1);
1057                              break;
1058                }
1059            }
1060                      if (newObject)
1061            {
1062                obj2.initRModuleUserAttributes();
1063                obj2.addRModuleUserAttribute(obj1);
1064            }
1065                      results.add(obj1);
1066        }
1067        return results;
1068    }
1069                                                            
1070                
1071                
1072
1073    /**
1074     * selects a collection of RModuleUserAttribute objects pre-filled with their
1075     * Attribute objects.
1076     *
1077     * This method is protected by default in order to keep the public
1078     * api reasonable. You can provide public methods for those you
1079     * actually need in RModuleUserAttributePeer.
1080     *
1081     * @throws TorqueException Any exceptions caught during processing will be
1082     * rethrown wrapped into a TorqueException.
1083     */

1084    protected static List JavaDoc doSelectJoinAttribute(Criteria criteria)
1085        throws TorqueException
1086    {
1087        setDbName(criteria);
1088
1089        RModuleUserAttributePeer.addSelectColumns(criteria);
1090        int offset = numColumns + 1;
1091        AttributePeer.addSelectColumns(criteria);
1092
1093
1094                        criteria.addJoin(RModuleUserAttributePeer.ATTRIBUTE_ID,
1095            AttributePeer.ATTRIBUTE_ID);
1096        
1097
1098                                                                                                                                      
1099        List JavaDoc rows = BasePeer.doSelect(criteria);
1100        List JavaDoc results = new ArrayList JavaDoc();
1101
1102        for (int i = 0; i < rows.size(); i++)
1103        {
1104            Record row = (Record) rows.get(i);
1105
1106                            Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
1107                    RModuleUserAttribute obj1 = (RModuleUserAttribute) RModuleUserAttributePeer
1108                .row2Object(row, 1, omClass);
1109                     omClass = AttributePeer.getOMClass();
1110                    Attribute obj2 = (Attribute)AttributePeer
1111                .row2Object(row, offset, omClass);
1112
1113            boolean newObject = true;
1114            for (int j = 0; j < results.size(); j++)
1115            {
1116                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1117                Attribute temp_obj2 = (Attribute)temp_obj1.getAttribute();
1118                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1119                {
1120                    newObject = false;
1121                              temp_obj2.addRModuleUserAttribute(obj1);
1122                              break;
1123                }
1124            }
1125                      if (newObject)
1126            {
1127                obj2.initRModuleUserAttributes();
1128                obj2.addRModuleUserAttribute(obj1);
1129            }
1130                      results.add(obj1);
1131        }
1132        return results;
1133    }
1134                    
1135  
1136                                                        
1137          
1138        
1139                                  
1140                
1141
1142    /**
1143     * selects a collection of RModuleUserAttribute objects pre-filled with
1144     * all related objects.
1145     *
1146     * This method is protected by default in order to keep the public
1147     * api reasonable. You can provide public methods for those you
1148     * actually need in RModuleUserAttributePeer.
1149     *
1150     * @throws TorqueException Any exceptions caught during processing will be
1151     * rethrown wrapped into a TorqueException.
1152     */

1153    protected static List JavaDoc doSelectJoinAllExceptMITList(Criteria criteria)
1154        throws TorqueException
1155    {
1156        setDbName(criteria);
1157
1158        addSelectColumns(criteria);
1159        int offset2 = numColumns + 1;
1160                                    
1161                                                  
1162                    ScarabModulePeer.addSelectColumns(criteria);
1163        int offset3 = offset2 + ScarabModulePeer.numColumns;
1164                                                                
1165                    ScarabUserImplPeer.addSelectColumns(criteria);
1166        int offset4 = offset3 + ScarabUserImplPeer.numColumns;
1167                                                                
1168                    IssueTypePeer.addSelectColumns(criteria);
1169        int offset5 = offset4 + IssueTypePeer.numColumns;
1170                                                                
1171                    AttributePeer.addSelectColumns(criteria);
1172        int offset6 = offset5 + AttributePeer.numColumns;
1173                                                                                                                                                                                  
1174        List JavaDoc rows = BasePeer.doSelect(criteria);
1175        List JavaDoc results = new ArrayList JavaDoc();
1176
1177        for (int i = 0; i < rows.size(); i++)
1178        {
1179            Record row = (Record)rows.get(i);
1180
1181                            Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
1182                    RModuleUserAttribute obj1 = (RModuleUserAttribute)RModuleUserAttributePeer
1183                .row2Object(row, 1, omClass);
1184                                                
1185                                                                              
1186                                                        
1187                            
1188              
1189                           omClass = ScarabModulePeer.getOMClass(row, offset2);
1190                          ScarabModule obj2 = (ScarabModule)ScarabModulePeer
1191                .row2Object( row, offset2, omClass);
1192
1193               boolean newObject = true;
1194            for (int j = 0; j < results.size(); j++)
1195            {
1196                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1197                ScarabModule temp_obj2 = (ScarabModule)temp_obj1.getModule();
1198                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1199                {
1200                    newObject = false;
1201                                    temp_obj2.addRModuleUserAttribute(obj1);
1202                                    break;
1203                }
1204            }
1205                            if (newObject)
1206            {
1207                obj2.initRModuleUserAttributes();
1208                obj2.addRModuleUserAttribute(obj1);
1209            }
1210                                                                                                
1211                                                        
1212                            
1213              
1214                           omClass = ScarabUserImplPeer.getOMClass();
1215                          ScarabUserImpl obj3 = (ScarabUserImpl)ScarabUserImplPeer
1216                .row2Object( row, offset3, omClass);
1217
1218               newObject = true;
1219            for (int j = 0; j < results.size(); j++)
1220            {
1221                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1222                ScarabUserImpl temp_obj3 = (ScarabUserImpl)temp_obj1.getScarabUser();
1223                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1224                {
1225                    newObject = false;
1226                                    temp_obj3.addRModuleUserAttribute(obj1);
1227                                    break;
1228                }
1229            }
1230                            if (newObject)
1231            {
1232                obj3.initRModuleUserAttributes();
1233                obj3.addRModuleUserAttribute(obj1);
1234            }
1235                                                                                    
1236                                                        
1237                            
1238              
1239                           omClass = IssueTypePeer.getOMClass();
1240                          IssueType obj4 = (IssueType)IssueTypePeer
1241                .row2Object( row, offset4, omClass);
1242
1243               newObject = true;
1244            for (int j = 0; j < results.size(); j++)
1245            {
1246                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1247                IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType();
1248                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1249                {
1250                    newObject = false;
1251                                    temp_obj4.addRModuleUserAttribute(obj1);
1252                                    break;
1253                }
1254            }
1255                            if (newObject)
1256            {
1257                obj4.initRModuleUserAttributes();
1258                obj4.addRModuleUserAttribute(obj1);
1259            }
1260                                                                                    
1261                                                        
1262                            
1263              
1264                           omClass = AttributePeer.getOMClass();
1265                          Attribute obj5 = (Attribute)AttributePeer
1266                .row2Object( row, offset5, omClass);
1267
1268               newObject = true;
1269            for (int j = 0; j < results.size(); j++)
1270            {
1271                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1272                Attribute temp_obj5 = (Attribute)temp_obj1.getAttribute();
1273                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1274                {
1275                    newObject = false;
1276                                    temp_obj5.addRModuleUserAttribute(obj1);
1277                                    break;
1278                }
1279            }
1280                            if (newObject)
1281            {
1282                obj5.initRModuleUserAttributes();
1283                obj5.addRModuleUserAttribute(obj1);
1284            }
1285                                                                results.add(obj1);
1286        }
1287        return results;
1288    }
1289        
1290        
1291                                  
1292                
1293
1294    /**
1295     * selects a collection of RModuleUserAttribute objects pre-filled with
1296     * all related objects.
1297     *
1298     * This method is protected by default in order to keep the public
1299     * api reasonable. You can provide public methods for those you
1300     * actually need in RModuleUserAttributePeer.
1301     *
1302     * @throws TorqueException Any exceptions caught during processing will be
1303     * rethrown wrapped into a TorqueException.
1304     */

1305    protected static List JavaDoc doSelectJoinAllExceptScarabModule(Criteria criteria)
1306        throws TorqueException
1307    {
1308        setDbName(criteria);
1309
1310        addSelectColumns(criteria);
1311        int offset2 = numColumns + 1;
1312                                    
1313                    MITListPeer.addSelectColumns(criteria);
1314        int offset3 = offset2 + MITListPeer.numColumns;
1315                                                                
1316                                                  
1317                    ScarabUserImplPeer.addSelectColumns(criteria);
1318        int offset4 = offset3 + ScarabUserImplPeer.numColumns;
1319                                                                
1320                    IssueTypePeer.addSelectColumns(criteria);
1321        int offset5 = offset4 + IssueTypePeer.numColumns;
1322                                                                
1323                    AttributePeer.addSelectColumns(criteria);
1324        int offset6 = offset5 + AttributePeer.numColumns;
1325                                                                                                                                                                                  
1326        List JavaDoc rows = BasePeer.doSelect(criteria);
1327        List JavaDoc results = new ArrayList JavaDoc();
1328
1329        for (int i = 0; i < rows.size(); i++)
1330        {
1331            Record row = (Record)rows.get(i);
1332
1333                            Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
1334                    RModuleUserAttribute obj1 = (RModuleUserAttribute)RModuleUserAttributePeer
1335                .row2Object(row, 1, omClass);
1336                                                
1337                                                        
1338                            
1339              
1340                           omClass = MITListPeer.getOMClass();
1341                          MITList obj2 = (MITList)MITListPeer
1342                .row2Object( row, offset2, omClass);
1343
1344               boolean newObject = true;
1345            for (int j = 0; j < results.size(); j++)
1346            {
1347                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1348                MITList temp_obj2 = (MITList)temp_obj1.getMITList();
1349                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1350                {
1351                    newObject = false;
1352                                    temp_obj2.addRModuleUserAttribute(obj1);
1353                                    break;
1354                }
1355            }
1356                            if (newObject)
1357            {
1358                obj2.initRModuleUserAttributes();
1359                obj2.addRModuleUserAttribute(obj1);
1360            }
1361                                                                                                
1362                                                                              
1363                                                        
1364                            
1365              
1366                           omClass = ScarabUserImplPeer.getOMClass();
1367                          ScarabUserImpl obj3 = (ScarabUserImpl)ScarabUserImplPeer
1368                .row2Object( row, offset3, omClass);
1369
1370               newObject = true;
1371            for (int j = 0; j < results.size(); j++)
1372            {
1373                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1374                ScarabUserImpl temp_obj3 = (ScarabUserImpl)temp_obj1.getScarabUser();
1375                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1376                {
1377                    newObject = false;
1378                                    temp_obj3.addRModuleUserAttribute(obj1);
1379                                    break;
1380                }
1381            }
1382                            if (newObject)
1383            {
1384                obj3.initRModuleUserAttributes();
1385                obj3.addRModuleUserAttribute(obj1);
1386            }
1387                                                                                    
1388                                                        
1389                            
1390              
1391                           omClass = IssueTypePeer.getOMClass();
1392                          IssueType obj4 = (IssueType)IssueTypePeer
1393                .row2Object( row, offset4, omClass);
1394
1395               newObject = true;
1396            for (int j = 0; j < results.size(); j++)
1397            {
1398                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1399                IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType();
1400                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1401                {
1402                    newObject = false;
1403                                    temp_obj4.addRModuleUserAttribute(obj1);
1404                                    break;
1405                }
1406            }
1407                            if (newObject)
1408            {
1409                obj4.initRModuleUserAttributes();
1410                obj4.addRModuleUserAttribute(obj1);
1411            }
1412                                                                                    
1413                                                        
1414                            
1415              
1416                           omClass = AttributePeer.getOMClass();
1417                          Attribute obj5 = (Attribute)AttributePeer
1418                .row2Object( row, offset5, omClass);
1419
1420               newObject = true;
1421            for (int j = 0; j < results.size(); j++)
1422            {
1423                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1424                Attribute temp_obj5 = (Attribute)temp_obj1.getAttribute();
1425                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1426                {
1427                    newObject = false;
1428                                    temp_obj5.addRModuleUserAttribute(obj1);
1429                                    break;
1430                }
1431            }
1432                            if (newObject)
1433            {
1434                obj5.initRModuleUserAttributes();
1435                obj5.addRModuleUserAttribute(obj1);
1436            }
1437                                                                results.add(obj1);
1438        }
1439        return results;
1440    }
1441        
1442        
1443                                  
1444                
1445
1446    /**
1447     * selects a collection of RModuleUserAttribute objects pre-filled with
1448     * all related objects.
1449     *
1450     * This method is protected by default in order to keep the public
1451     * api reasonable. You can provide public methods for those you
1452     * actually need in RModuleUserAttributePeer.
1453     *
1454     * @throws TorqueException Any exceptions caught during processing will be
1455     * rethrown wrapped into a TorqueException.
1456     */

1457    protected static List JavaDoc doSelectJoinAllExceptScarabUserImpl(Criteria criteria)
1458        throws TorqueException
1459    {
1460        setDbName(criteria);
1461
1462        addSelectColumns(criteria);
1463        int offset2 = numColumns + 1;
1464                                    
1465                    MITListPeer.addSelectColumns(criteria);
1466        int offset3 = offset2 + MITListPeer.numColumns;
1467                                                                
1468                    ScarabModulePeer.addSelectColumns(criteria);
1469        int offset4 = offset3 + ScarabModulePeer.numColumns;
1470                                                                
1471                                                  
1472                    IssueTypePeer.addSelectColumns(criteria);
1473        int offset5 = offset4 + IssueTypePeer.numColumns;
1474                                                                
1475                    AttributePeer.addSelectColumns(criteria);
1476        int offset6 = offset5 + AttributePeer.numColumns;
1477                                                                                                                                                                                  
1478        List JavaDoc rows = BasePeer.doSelect(criteria);
1479        List JavaDoc results = new ArrayList JavaDoc();
1480
1481        for (int i = 0; i < rows.size(); i++)
1482        {
1483            Record row = (Record)rows.get(i);
1484
1485                            Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
1486                    RModuleUserAttribute obj1 = (RModuleUserAttribute)RModuleUserAttributePeer
1487                .row2Object(row, 1, omClass);
1488                                                
1489                                                        
1490                            
1491              
1492                           omClass = MITListPeer.getOMClass();
1493                          MITList obj2 = (MITList)MITListPeer
1494                .row2Object( row, offset2, omClass);
1495
1496               boolean newObject = true;
1497            for (int j = 0; j < results.size(); j++)
1498            {
1499                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1500                MITList temp_obj2 = (MITList)temp_obj1.getMITList();
1501                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1502                {
1503                    newObject = false;
1504                                    temp_obj2.addRModuleUserAttribute(obj1);
1505                                    break;
1506                }
1507            }
1508                            if (newObject)
1509            {
1510                obj2.initRModuleUserAttributes();
1511                obj2.addRModuleUserAttribute(obj1);
1512            }
1513                                                                                                
1514                                                        
1515                            
1516              
1517                           omClass = ScarabModulePeer.getOMClass(row, offset3);
1518                          ScarabModule obj3 = (ScarabModule)ScarabModulePeer
1519                .row2Object( row, offset3, omClass);
1520
1521               newObject = true;
1522            for (int j = 0; j < results.size(); j++)
1523            {
1524                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1525                ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule();
1526                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1527                {
1528                    newObject = false;
1529                                    temp_obj3.addRModuleUserAttribute(obj1);
1530                                    break;
1531                }
1532            }
1533                            if (newObject)
1534            {
1535                obj3.initRModuleUserAttributes();
1536                obj3.addRModuleUserAttribute(obj1);
1537            }
1538                                                                                                
1539                                                                  
1540                                                        
1541                            
1542              
1543                           omClass = IssueTypePeer.getOMClass();
1544                          IssueType obj4 = (IssueType)IssueTypePeer
1545                .row2Object( row, offset4, omClass);
1546
1547               newObject = true;
1548            for (int j = 0; j < results.size(); j++)
1549            {
1550                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1551                IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType();
1552                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1553                {
1554                    newObject = false;
1555                                    temp_obj4.addRModuleUserAttribute(obj1);
1556                                    break;
1557                }
1558            }
1559                            if (newObject)
1560            {
1561                obj4.initRModuleUserAttributes();
1562                obj4.addRModuleUserAttribute(obj1);
1563            }
1564                                                                                    
1565                                                        
1566                            
1567              
1568                           omClass = AttributePeer.getOMClass();
1569                          Attribute obj5 = (Attribute)AttributePeer
1570                .row2Object( row, offset5, omClass);
1571
1572               newObject = true;
1573            for (int j = 0; j < results.size(); j++)
1574            {
1575                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1576                Attribute temp_obj5 = (Attribute)temp_obj1.getAttribute();
1577                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1578                {
1579                    newObject = false;
1580                                    temp_obj5.addRModuleUserAttribute(obj1);
1581                                    break;
1582                }
1583            }
1584                            if (newObject)
1585            {
1586                obj5.initRModuleUserAttributes();
1587                obj5.addRModuleUserAttribute(obj1);
1588            }
1589                                                                results.add(obj1);
1590        }
1591        return results;
1592    }
1593        
1594        
1595                                  
1596                
1597
1598    /**
1599     * selects a collection of RModuleUserAttribute objects pre-filled with
1600     * all related objects.
1601     *
1602     * This method is protected by default in order to keep the public
1603     * api reasonable. You can provide public methods for those you
1604     * actually need in RModuleUserAttributePeer.
1605     *
1606     * @throws TorqueException Any exceptions caught during processing will be
1607     * rethrown wrapped into a TorqueException.
1608     */

1609    protected static List JavaDoc doSelectJoinAllExceptIssueType(Criteria criteria)
1610        throws TorqueException
1611    {
1612        setDbName(criteria);
1613
1614        addSelectColumns(criteria);
1615        int offset2 = numColumns + 1;
1616                                    
1617                    MITListPeer.addSelectColumns(criteria);
1618        int offset3 = offset2 + MITListPeer.numColumns;
1619                                                                
1620                    ScarabModulePeer.addSelectColumns(criteria);
1621        int offset4 = offset3 + ScarabModulePeer.numColumns;
1622                                                                
1623                    ScarabUserImplPeer.addSelectColumns(criteria);
1624        int offset5 = offset4 + ScarabUserImplPeer.numColumns;
1625                                                                
1626                                                  
1627                    AttributePeer.addSelectColumns(criteria);
1628        int offset6 = offset5 + AttributePeer.numColumns;
1629                                                                                                                                                                                  
1630        List JavaDoc rows = BasePeer.doSelect(criteria);
1631        List JavaDoc results = new ArrayList JavaDoc();
1632
1633        for (int i = 0; i < rows.size(); i++)
1634        {
1635            Record row = (Record)rows.get(i);
1636
1637                            Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
1638                    RModuleUserAttribute obj1 = (RModuleUserAttribute)RModuleUserAttributePeer
1639                .row2Object(row, 1, omClass);
1640                                                
1641                                                        
1642                            
1643              
1644                           omClass = MITListPeer.getOMClass();
1645                          MITList obj2 = (MITList)MITListPeer
1646                .row2Object( row, offset2, omClass);
1647
1648               boolean newObject = true;
1649            for (int j = 0; j < results.size(); j++)
1650            {
1651                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1652                MITList temp_obj2 = (MITList)temp_obj1.getMITList();
1653                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1654                {
1655                    newObject = false;
1656                                    temp_obj2.addRModuleUserAttribute(obj1);
1657                                    break;
1658                }
1659            }
1660                            if (newObject)
1661            {
1662                obj2.initRModuleUserAttributes();
1663                obj2.addRModuleUserAttribute(obj1);
1664            }
1665                                                                                                
1666                                                        
1667                            
1668              
1669                           omClass = ScarabModulePeer.getOMClass(row, offset3);
1670                          ScarabModule obj3 = (ScarabModule)ScarabModulePeer
1671                .row2Object( row, offset3, omClass);
1672
1673               newObject = true;
1674            for (int j = 0; j < results.size(); j++)
1675            {
1676                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1677                ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule();
1678                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1679                {
1680                    newObject = false;
1681                                    temp_obj3.addRModuleUserAttribute(obj1);
1682                                    break;
1683                }
1684            }
1685                            if (newObject)
1686            {
1687                obj3.initRModuleUserAttributes();
1688                obj3.addRModuleUserAttribute(obj1);
1689            }
1690                                                                                                
1691                                                        
1692                            
1693              
1694                           omClass = ScarabUserImplPeer.getOMClass();
1695                          ScarabUserImpl obj4 = (ScarabUserImpl)ScarabUserImplPeer
1696                .row2Object( row, offset4, omClass);
1697
1698               newObject = true;
1699            for (int j = 0; j < results.size(); j++)
1700            {
1701                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1702                ScarabUserImpl temp_obj4 = (ScarabUserImpl)temp_obj1.getScarabUser();
1703                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1704                {
1705                    newObject = false;
1706                                    temp_obj4.addRModuleUserAttribute(obj1);
1707                                    break;
1708                }
1709            }
1710                            if (newObject)
1711            {
1712                obj4.initRModuleUserAttributes();
1713                obj4.addRModuleUserAttribute(obj1);
1714            }
1715                                                                                    
1716                                                                  
1717                                                        
1718                            
1719              
1720                           omClass = AttributePeer.getOMClass();
1721                          Attribute obj5 = (Attribute)AttributePeer
1722                .row2Object( row, offset5, omClass);
1723
1724               newObject = true;
1725            for (int j = 0; j < results.size(); j++)
1726            {
1727                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1728                Attribute temp_obj5 = (Attribute)temp_obj1.getAttribute();
1729                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1730                {
1731                    newObject = false;
1732                                    temp_obj5.addRModuleUserAttribute(obj1);
1733                                    break;
1734                }
1735            }
1736                            if (newObject)
1737            {
1738                obj5.initRModuleUserAttributes();
1739                obj5.addRModuleUserAttribute(obj1);
1740            }
1741                                                                results.add(obj1);
1742        }
1743        return results;
1744    }
1745        
1746        
1747                                  
1748                
1749
1750    /**
1751     * selects a collection of RModuleUserAttribute objects pre-filled with
1752     * all related objects.
1753     *
1754     * This method is protected by default in order to keep the public
1755     * api reasonable. You can provide public methods for those you
1756     * actually need in RModuleUserAttributePeer.
1757     *
1758     * @throws TorqueException Any exceptions caught during processing will be
1759     * rethrown wrapped into a TorqueException.
1760     */

1761    protected static List JavaDoc doSelectJoinAllExceptAttribute(Criteria criteria)
1762        throws TorqueException
1763    {
1764        setDbName(criteria);
1765
1766        addSelectColumns(criteria);
1767        int offset2 = numColumns + 1;
1768                                    
1769                    MITListPeer.addSelectColumns(criteria);
1770        int offset3 = offset2 + MITListPeer.numColumns;
1771                                                                
1772                    ScarabModulePeer.addSelectColumns(criteria);
1773        int offset4 = offset3 + ScarabModulePeer.numColumns;
1774                                                                
1775                    ScarabUserImplPeer.addSelectColumns(criteria);
1776        int offset5 = offset4 + ScarabUserImplPeer.numColumns;
1777                                                                
1778                    IssueTypePeer.addSelectColumns(criteria);
1779        int offset6 = offset5 + IssueTypePeer.numColumns;
1780                                                                
1781                                                                                                                                                                    
1782        List JavaDoc rows = BasePeer.doSelect(criteria);
1783        List JavaDoc results = new ArrayList JavaDoc();
1784
1785        for (int i = 0; i < rows.size(); i++)
1786        {
1787            Record row = (Record)rows.get(i);
1788
1789                            Class JavaDoc omClass = RModuleUserAttributePeer.getOMClass();
1790                    RModuleUserAttribute obj1 = (RModuleUserAttribute)RModuleUserAttributePeer
1791                .row2Object(row, 1, omClass);
1792                                                
1793                                                        
1794                            
1795              
1796                           omClass = MITListPeer.getOMClass();
1797                          MITList obj2 = (MITList)MITListPeer
1798                .row2Object( row, offset2, omClass);
1799
1800               boolean newObject = true;
1801            for (int j = 0; j < results.size(); j++)
1802            {
1803                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1804                MITList temp_obj2 = (MITList)temp_obj1.getMITList();
1805                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1806                {
1807                    newObject = false;
1808                                    temp_obj2.addRModuleUserAttribute(obj1);
1809                                    break;
1810                }
1811            }
1812                            if (newObject)
1813            {
1814                obj2.initRModuleUserAttributes();
1815                obj2.addRModuleUserAttribute(obj1);
1816            }
1817                                                                                                
1818                                                        
1819                            
1820              
1821                           omClass = ScarabModulePeer.getOMClass(row, offset3);
1822                          ScarabModule obj3 = (ScarabModule)ScarabModulePeer
1823                .row2Object( row, offset3, omClass);
1824
1825               newObject = true;
1826            for (int j = 0; j < results.size(); j++)
1827            {
1828                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1829                ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule();
1830                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1831                {
1832                    newObject = false;
1833                                    temp_obj3.addRModuleUserAttribute(obj1);
1834                                    break;
1835                }
1836            }
1837                            if (newObject)
1838            {
1839                obj3.initRModuleUserAttributes();
1840                obj3.addRModuleUserAttribute(obj1);
1841            }
1842                                                                                                
1843                                                        
1844                            
1845              
1846                           omClass = ScarabUserImplPeer.getOMClass();
1847                          ScarabUserImpl obj4 = (ScarabUserImpl)ScarabUserImplPeer
1848                .row2Object( row, offset4, omClass);
1849
1850               newObject = true;
1851            for (int j = 0; j < results.size(); j++)
1852            {
1853                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1854                ScarabUserImpl temp_obj4 = (ScarabUserImpl)temp_obj1.getScarabUser();
1855                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1856                {
1857                    newObject = false;
1858                                    temp_obj4.addRModuleUserAttribute(obj1);
1859                                    break;
1860                }
1861            }
1862                            if (newObject)
1863            {
1864                obj4.initRModuleUserAttributes();
1865                obj4.addRModuleUserAttribute(obj1);
1866            }
1867                                                                                    
1868                                                        
1869                            
1870              
1871                           omClass = IssueTypePeer.getOMClass();
1872                          IssueType obj5 = (IssueType)IssueTypePeer
1873                .row2Object( row, offset5, omClass);
1874
1875               newObject = true;
1876            for (int j = 0; j < results.size(); j++)
1877            {
1878                RModuleUserAttribute temp_obj1 = (RModuleUserAttribute)results.get(j);
1879                IssueType temp_obj5 = (IssueType)temp_obj1.getIssueType();
1880                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1881                {
1882                    newObject = false;
1883                                    temp_obj5.addRModuleUserAttribute(obj1);
1884                                    break;
1885                }
1886            }
1887                            if (newObject)
1888            {
1889                obj5.initRModuleUserAttributes();
1890                obj5.addRModuleUserAttribute(obj1);
1891            }
1892                                                                                    
1893                                              results.add(obj1);
1894        }
1895        return results;
1896    }
1897                    
1898  
1899      /**
1900     * Returns the TableMap related to this peer. This method is not
1901     * needed for general use but a specific application could have a need.
1902     *
1903     * @throws TorqueException Any exceptions caught during processing will be
1904     * rethrown wrapped into a TorqueException.
1905     */

1906    protected static TableMap getTableMap()
1907        throws TorqueException
1908    {
1909        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
1910    }
1911   
1912    private static void setDbName(Criteria crit)
1913    {
1914        // Set the correct dbName if it has not been overridden
1915
// crit.getDbName will return the same object if not set to
1916
// another value so == check is okay and faster
1917
if (crit.getDbName() == Torque.getDefaultDB())
1918        {
1919            crit.setDbName(DATABASE_NAME);
1920        }
1921    }
1922}
1923
Popular Tags