KickJava   Java API By Example, From Geeks To Geeks.

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


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   
42   
43 /**
44  */

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

60     public static MapBuilder getMapBuilder()
61         throws TorqueException
62     {
63         return getMapBuilder(ActivityMapBuilder.CLASS_NAME);
64     }
65
66       /** the column name for the ACTIVITY_ID field */
67     public static final String JavaDoc ACTIVITY_ID;
68       /** the column name for the ISSUE_ID field */
69     public static final String JavaDoc ISSUE_ID;
70       /** the column name for the ATTRIBUTE_ID field */
71     public static final String JavaDoc ATTRIBUTE_ID;
72       /** the column name for the TRANSACTION_ID field */
73     public static final String JavaDoc TRANSACTION_ID;
74       /** the column name for the OLD_NUMERIC_VALUE field */
75     public static final String JavaDoc OLD_NUMERIC_VALUE;
76       /** the column name for the NEW_NUMERIC_VALUE field */
77     public static final String JavaDoc NEW_NUMERIC_VALUE;
78       /** the column name for the OLD_USER_ID field */
79     public static final String JavaDoc OLD_USER_ID;
80       /** the column name for the NEW_USER_ID field */
81     public static final String JavaDoc NEW_USER_ID;
82       /** the column name for the OLD_OPTION_ID field */
83     public static final String JavaDoc OLD_OPTION_ID;
84       /** the column name for the NEW_OPTION_ID field */
85     public static final String JavaDoc NEW_OPTION_ID;
86       /** the column name for the OLD_VALUE field */
87     public static final String JavaDoc OLD_VALUE;
88       /** the column name for the NEW_VALUE field */
89     public static final String JavaDoc NEW_VALUE;
90       /** the column name for the DEPEND_ID field */
91     public static final String JavaDoc DEPEND_ID;
92       /** the column name for the DESCRIPTION field */
93     public static final String JavaDoc DESCRIPTION;
94       /** the column name for the END_DATE field */
95     public static final String JavaDoc END_DATE;
96       /** the column name for the ATTACHMENT_ID field */
97     public static final String JavaDoc ATTACHMENT_ID;
98   
99     static
100     {
101           ACTIVITY_ID = "SCARAB_ACTIVITY.ACTIVITY_ID";
102           ISSUE_ID = "SCARAB_ACTIVITY.ISSUE_ID";
103           ATTRIBUTE_ID = "SCARAB_ACTIVITY.ATTRIBUTE_ID";
104           TRANSACTION_ID = "SCARAB_ACTIVITY.TRANSACTION_ID";
105           OLD_NUMERIC_VALUE = "SCARAB_ACTIVITY.OLD_NUMERIC_VALUE";
106           NEW_NUMERIC_VALUE = "SCARAB_ACTIVITY.NEW_NUMERIC_VALUE";
107           OLD_USER_ID = "SCARAB_ACTIVITY.OLD_USER_ID";
108           NEW_USER_ID = "SCARAB_ACTIVITY.NEW_USER_ID";
109           OLD_OPTION_ID = "SCARAB_ACTIVITY.OLD_OPTION_ID";
110           NEW_OPTION_ID = "SCARAB_ACTIVITY.NEW_OPTION_ID";
111           OLD_VALUE = "SCARAB_ACTIVITY.OLD_VALUE";
112           NEW_VALUE = "SCARAB_ACTIVITY.NEW_VALUE";
113           DEPEND_ID = "SCARAB_ACTIVITY.DEPEND_ID";
114           DESCRIPTION = "SCARAB_ACTIVITY.DESCRIPTION";
115           END_DATE = "SCARAB_ACTIVITY.END_DATE";
116           ATTACHMENT_ID = "SCARAB_ACTIVITY.ATTACHMENT_ID";
117           if (Torque.isInit())
118         {
119             try
120             {
121                 getMapBuilder(ActivityMapBuilder.CLASS_NAME);
122             }
123             catch (Exception JavaDoc e)
124             {
125                 log.error("Could not initialize Peer", e);
126             }
127         }
128         else
129         {
130             Torque.registerMapBuilder(ActivityMapBuilder.CLASS_NAME);
131         }
132     }
133  
134     /** number of columns for this peer */
135     public static final int numColumns = 16;
136
137     /** A class that can be returned by this peer. */
138     protected static final String JavaDoc CLASSNAME_DEFAULT =
139         "org.tigris.scarab.om.Activity";
140
141     /** A class that can be returned by this peer. */
142     protected static final Class JavaDoc CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
143
144     /**
145      * Class object initialization method.
146      *
147      * @param className name of the class to initialize
148      * @return the initialized class
149      */

150     private static Class JavaDoc initClass(String JavaDoc className)
151     {
152         Class JavaDoc c = null;
153         try
154         {
155             c = Class.forName(className);
156         }
157         catch (Throwable JavaDoc t)
158         {
159             log.error("A FATAL ERROR has occurred which should not "
160                 + "have happened under any circumstance. Please notify "
161                 + "the Torque developers <torque-dev@db.apache.org> "
162                 + "and give as many details as possible (including the error "
163                 + "stack trace).", t);
164
165             // Error objects should always be propogated.
166
if (t instanceof Error JavaDoc)
167             {
168                 throw (Error JavaDoc) t.fillInStackTrace();
169             }
170         }
171         return c;
172     }
173
174     /**
175      * Get the list of objects for a ResultSet. Please not that your
176      * resultset MUST return columns in the right order. You can use
177      * getFieldNames() in BaseObject to get the correct sequence.
178      *
179      * @param results the ResultSet
180      * @return the list of objects
181      * @throws TorqueException Any exceptions caught during processing will be
182      * rethrown wrapped into a TorqueException.
183      */

184     public static List JavaDoc resultSet2Objects(java.sql.ResultSet JavaDoc results)
185             throws TorqueException
186     {
187         try
188         {
189             QueryDataSet qds = null;
190             List JavaDoc rows = null;
191             try
192             {
193                 qds = new QueryDataSet(results);
194                 rows = getSelectResults(qds);
195             }
196             finally
197             {
198                 if (qds != null)
199                 {
200                     qds.close();
201                 }
202             }
203
204             return populateObjects(rows);
205         }
206         catch (SQLException JavaDoc e)
207         {
208             throw new TorqueException(e);
209         }
210         catch (DataSetException e)
211         {
212             throw new TorqueException(e);
213         }
214     }
215
216
217   
218     /**
219      * Method to do inserts.
220      *
221      * @param criteria object used to create the INSERT statement.
222      * @throws TorqueException Any exceptions caught during processing will be
223      * rethrown wrapped into a TorqueException.
224      */

225     public static ObjectKey doInsert(Criteria criteria)
226         throws TorqueException
227     {
228         return BaseActivityPeer
229             .doInsert(criteria, (Connection JavaDoc) null);
230     }
231
232     /**
233      * Method to do inserts. This method is to be used during a transaction,
234      * otherwise use the doInsert(Criteria) method. It will take care of
235      * the connection details internally.
236      *
237      * @param criteria object used to create the INSERT statement.
238      * @param con the connection to use
239      * @throws TorqueException Any exceptions caught during processing will be
240      * rethrown wrapped into a TorqueException.
241      */

242     public static ObjectKey doInsert(Criteria criteria, Connection JavaDoc con)
243         throws TorqueException
244     {
245                                                                                                   
246         setDbName(criteria);
247
248         if (con == null)
249         {
250             return BasePeer.doInsert(criteria);
251         }
252         else
253         {
254             return BasePeer.doInsert(criteria, con);
255         }
256     }
257
258     /**
259      * Add all the columns needed to create a new object.
260      *
261      * @param criteria object containing the columns to add.
262      * @throws TorqueException Any exceptions caught during processing will be
263      * rethrown wrapped into a TorqueException.
264      */

265     public static void addSelectColumns(Criteria criteria)
266             throws TorqueException
267     {
268           criteria.addSelectColumn(ACTIVITY_ID);
269           criteria.addSelectColumn(ISSUE_ID);
270           criteria.addSelectColumn(ATTRIBUTE_ID);
271           criteria.addSelectColumn(TRANSACTION_ID);
272           criteria.addSelectColumn(OLD_NUMERIC_VALUE);
273           criteria.addSelectColumn(NEW_NUMERIC_VALUE);
274           criteria.addSelectColumn(OLD_USER_ID);
275           criteria.addSelectColumn(NEW_USER_ID);
276           criteria.addSelectColumn(OLD_OPTION_ID);
277           criteria.addSelectColumn(NEW_OPTION_ID);
278           criteria.addSelectColumn(OLD_VALUE);
279           criteria.addSelectColumn(NEW_VALUE);
280           criteria.addSelectColumn(DEPEND_ID);
281           criteria.addSelectColumn(DESCRIPTION);
282           criteria.addSelectColumn(END_DATE);
283           criteria.addSelectColumn(ATTACHMENT_ID);
284       }
285
286     /**
287      * Create a new object of type cls from a resultset row starting
288      * from a specified offset. This is done so that you can select
289      * other rows than just those needed for this object. You may
290      * for example want to create two objects from the same row.
291      *
292      * @throws TorqueException Any exceptions caught during processing will be
293      * rethrown wrapped into a TorqueException.
294      */

295     public static Activity row2Object(Record row,
296                                              int offset,
297                                              Class JavaDoc cls)
298         throws TorqueException
299     {
300         try
301         {
302             Activity obj = (Activity) cls.newInstance();
303             ActivityPeer.populateObject(row, offset, obj);
304                   obj.setModified(false);
305               obj.setNew(false);
306
307             return obj;
308         }
309         catch (InstantiationException JavaDoc e)
310         {
311             throw new TorqueException(e);
312         }
313         catch (IllegalAccessException JavaDoc e)
314         {
315             throw new TorqueException(e);
316         }
317     }
318
319     /**
320      * Populates an object from a resultset row starting
321      * from a specified offset. This is done so that you can select
322      * other rows than just those needed for this object. You may
323      * for example want to create two objects from the same row.
324      *
325      * @throws TorqueException Any exceptions caught during processing will be
326      * rethrown wrapped into a TorqueException.
327      */

328     public static void populateObject(Record row,
329                                       int offset,
330                                       Activity obj)
331         throws TorqueException
332     {
333         try
334         {
335                 obj.setActivityId(row.getValue(offset + 0).asLongObj());
336                   obj.setIssueId(row.getValue(offset + 1).asLongObj());
337                   obj.setAttributeId(row.getValue(offset + 2).asIntegerObj());
338                   obj.setTransactionId(row.getValue(offset + 3).asLongObj());
339                   obj.setOldNumericValue(row.getValue(offset + 4).asIntegerObj());
340                   obj.setNewNumericValue(row.getValue(offset + 5).asIntegerObj());
341                   obj.setOldUserId(row.getValue(offset + 6).asIntegerObj());
342                   obj.setNewUserId(row.getValue(offset + 7).asIntegerObj());
343                   obj.setOldOptionId(row.getValue(offset + 8).asIntegerObj());
344                   obj.setNewOptionId(row.getValue(offset + 9).asIntegerObj());
345                   obj.setOldValue(row.getValue(offset + 10).asString());
346                   obj.setNewValue(row.getValue(offset + 11).asString());
347                   obj.setDependId(row.getValue(offset + 12).asIntegerObj());
348                   obj.setDescription(row.getValue(offset + 13).asString());
349                   obj.setEndDate(row.getValue(offset + 14).asUtilDate());
350                   obj.setAttachmentId(row.getValue(offset + 15).asLongObj());
351               }
352         catch (DataSetException e)
353         {
354             throw new TorqueException(e);
355         }
356     }
357
358     /**
359      * Method to do selects.
360      *
361      * @param criteria object used to create the SELECT statement.
362      * @return List of selected Objects
363      * @throws TorqueException Any exceptions caught during processing will be
364      * rethrown wrapped into a TorqueException.
365      */

366     public static List JavaDoc doSelect(Criteria criteria) throws TorqueException
367     {
368         return populateObjects(doSelectVillageRecords(criteria));
369     }
370
371     /**
372      * Method to do selects within a transaction.
373      *
374      * @param criteria object used to create the SELECT statement.
375      * @param con the connection to use
376      * @return List of selected Objects
377      * @throws TorqueException Any exceptions caught during processing will be
378      * rethrown wrapped into a TorqueException.
379      */

380     public static List JavaDoc doSelect(Criteria criteria, Connection JavaDoc con)
381         throws TorqueException
382     {
383         return populateObjects(doSelectVillageRecords(criteria, con));
384     }
385
386     /**
387      * Grabs the raw Village records to be formed into objects.
388      * This method handles connections internally. The Record objects
389      * returned by this method should be considered readonly. Do not
390      * alter the data and call save(), your results may vary, but are
391      * certainly likely to result in hard to track MT bugs.
392      *
393      * @throws TorqueException Any exceptions caught during processing will be
394      * rethrown wrapped into a TorqueException.
395      */

396     public static List JavaDoc doSelectVillageRecords(Criteria criteria)
397         throws TorqueException
398     {
399         return BaseActivityPeer
400             .doSelectVillageRecords(criteria, (Connection JavaDoc) null);
401     }
402
403     /**
404      * Grabs the raw Village records to be formed into objects.
405      * This method should be used for transactions
406      *
407      * @param criteria object used to create the SELECT statement.
408      * @param con the connection to use
409      * @throws TorqueException Any exceptions caught during processing will be
410      * rethrown wrapped into a TorqueException.
411      */

412     public static List JavaDoc doSelectVillageRecords(Criteria criteria, Connection JavaDoc con)
413         throws TorqueException
414     {
415         if (criteria.getSelectColumns().size() == 0)
416         {
417             addSelectColumns(criteria);
418         }
419
420                                                                                                   
421         setDbName(criteria);
422
423         // BasePeer returns a List of Value (Village) arrays. The array
424
// order follows the order columns were placed in the Select clause.
425
if (con == null)
426         {
427             return BasePeer.doSelect(criteria);
428         }
429         else
430         {
431             return BasePeer.doSelect(criteria, con);
432         }
433     }
434
435     /**
436      * The returned List will contain objects of the default type or
437      * objects that inherit from the default.
438      *
439      * @throws TorqueException Any exceptions caught during processing will be
440      * rethrown wrapped into a TorqueException.
441      */

442     public static List JavaDoc populateObjects(List JavaDoc records)
443         throws TorqueException
444     {
445         List JavaDoc results = new ArrayList JavaDoc(records.size());
446
447         // populate the object(s)
448
for (int i = 0; i < records.size(); i++)
449         {
450             Record row = (Record) records.get(i);
451               results.add(ActivityPeer.row2Object(row, 1,
452                 ActivityPeer.getOMClass()));
453           }
454         return results;
455     }
456  
457
458     /**
459      * The class that the Peer will make instances of.
460      * If the BO is abstract then you must implement this method
461      * in the BO.
462      *
463      * @throws TorqueException Any exceptions caught during processing will be
464      * rethrown wrapped into a TorqueException.
465      */

466     public static Class JavaDoc getOMClass()
467         throws TorqueException
468     {
469         return CLASS_DEFAULT;
470     }
471
472     /**
473      * Method to do updates.
474      *
475      * @param criteria object containing data that is used to create the UPDATE
476      * statement.
477      * @throws TorqueException Any exceptions caught during processing will be
478      * rethrown wrapped into a TorqueException.
479      */

480     public static void doUpdate(Criteria criteria) throws TorqueException
481     {
482          BaseActivityPeer
483             .doUpdate(criteria, (Connection JavaDoc) null);
484     }
485
486     /**
487      * Method to do updates. This method is to be used during a transaction,
488      * otherwise use the doUpdate(Criteria) method. It will take care of
489      * the connection details internally.
490      *
491      * @param criteria object containing data that is used to create the UPDATE
492      * statement.
493      * @param con the connection to use
494      * @throws TorqueException Any exceptions caught during processing will be
495      * rethrown wrapped into a TorqueException.
496      */

497     public static void doUpdate(Criteria criteria, Connection JavaDoc con)
498         throws TorqueException
499     {
500         Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
501                    selectCriteria.put(ACTIVITY_ID, criteria.remove(ACTIVITY_ID));
502                                                                                                                                                             
503         setDbName(criteria);
504
505         if (con == null)
506         {
507             BasePeer.doUpdate(selectCriteria, criteria);
508         }
509         else
510         {
511             BasePeer.doUpdate(selectCriteria, criteria, con);
512         }
513     }
514
515     /**
516      * Method to do deletes.
517      *
518      * @param criteria object containing data that is used DELETE from database.
519      * @throws TorqueException Any exceptions caught during processing will be
520      * rethrown wrapped into a TorqueException.
521      */

522      public static void doDelete(Criteria criteria) throws TorqueException
523      {
524          ActivityPeer
525             .doDelete(criteria, (Connection JavaDoc) null);
526      }
527
528     /**
529      * Method to do deletes. This method is to be used during a transaction,
530      * otherwise use the doDelete(Criteria) method. It will take care of
531      * the connection details internally.
532      *
533      * @param criteria object containing data that is used DELETE from database.
534      * @param con the connection to use
535      * @throws TorqueException Any exceptions caught during processing will be
536      * rethrown wrapped into a TorqueException.
537      */

538      public static void doDelete(Criteria criteria, Connection JavaDoc con)
539         throws TorqueException
540      {
541                                                                                                   
542         setDbName(criteria);
543
544         if (con == null)
545         {
546             BasePeer.doDelete(criteria);
547         }
548         else
549         {
550             BasePeer.doDelete(criteria, con);
551         }
552      }
553
554     /**
555      * Method to do selects
556      *
557      * @throws TorqueException Any exceptions caught during processing will be
558      * rethrown wrapped into a TorqueException.
559      */

560     public static List JavaDoc doSelect(Activity obj) throws TorqueException
561     {
562         return doSelect(buildSelectCriteria(obj));
563     }
564
565     /**
566      * Method to do inserts
567      *
568      * @throws TorqueException Any exceptions caught during processing will be
569      * rethrown wrapped into a TorqueException.
570      */

571     public static void doInsert(Activity obj) throws TorqueException
572     {
573           obj.setPrimaryKey(doInsert(buildCriteria(obj)));
574           obj.setNew(false);
575         obj.setModified(false);
576     }
577
578     /**
579      * @param obj the data object to update in the database.
580      * @throws TorqueException Any exceptions caught during processing will be
581      * rethrown wrapped into a TorqueException.
582      */

583     public static void doUpdate(Activity obj) throws TorqueException
584     {
585         doUpdate(buildCriteria(obj));
586         obj.setModified(false);
587     }
588
589     /**
590      * @param obj the data object to delete in the database.
591      * @throws TorqueException Any exceptions caught during processing will be
592      * rethrown wrapped into a TorqueException.
593      */

594     public static void doDelete(Activity obj) throws TorqueException
595     {
596         doDelete(buildSelectCriteria(obj));
597     }
598
599     /**
600      * Method to do inserts. This method is to be used during a transaction,
601      * otherwise use the doInsert(Activity) method. It will take
602      * care of the connection details internally.
603      *
604      * @param obj the data object to insert into the database.
605      * @param con the connection to use
606      * @throws TorqueException Any exceptions caught during processing will be
607      * rethrown wrapped into a TorqueException.
608      */

609     public static void doInsert(Activity obj, Connection JavaDoc con)
610         throws TorqueException
611     {
612           obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
613           obj.setNew(false);
614         obj.setModified(false);
615     }
616
617     /**
618      * Method to do update. This method is to be used during a transaction,
619      * otherwise use the doUpdate(Activity) method. It will take
620      * care of the connection details internally.
621      *
622      * @param obj the data object to update in the database.
623      * @param con the connection to use
624      * @throws TorqueException Any exceptions caught during processing will be
625      * rethrown wrapped into a TorqueException.
626      */

627     public static void doUpdate(Activity obj, Connection JavaDoc con)
628         throws TorqueException
629     {
630         doUpdate(buildCriteria(obj), con);
631         obj.setModified(false);
632     }
633
634     /**
635      * Method to delete. This method is to be used during a transaction,
636      * otherwise use the doDelete(Activity) method. It will take
637      * care of the connection details internally.
638      *
639      * @param obj the data object to delete in the database.
640      * @param con the connection to use
641      * @throws TorqueException Any exceptions caught during processing will be
642      * rethrown wrapped into a TorqueException.
643      */

644     public static void doDelete(Activity obj, Connection JavaDoc con)
645         throws TorqueException
646     {
647         doDelete(buildSelectCriteria(obj), con);
648     }
649
650     /**
651      * Method to do deletes.
652      *
653      * @param pk ObjectKey that is used DELETE from database.
654      * @throws TorqueException Any exceptions caught during processing will be
655      * rethrown wrapped into a TorqueException.
656      */

657     public static void doDelete(ObjectKey pk) throws TorqueException
658     {
659         BaseActivityPeer
660            .doDelete(pk, (Connection JavaDoc) null);
661     }
662
663     /**
664      * Method to delete. This method is to be used during a transaction,
665      * otherwise use the doDelete(ObjectKey) method. It will take
666      * care of the connection details internally.
667      *
668      * @param pk the primary key for the object to delete in the database.
669      * @param con the connection to use
670      * @throws TorqueException Any exceptions caught during processing will be
671      * rethrown wrapped into a TorqueException.
672      */

673     public static void doDelete(ObjectKey pk, Connection JavaDoc con)
674         throws TorqueException
675     {
676         doDelete(buildCriteria(pk), con);
677     }
678
679     /** Build a Criteria object from an ObjectKey */
680     public static Criteria buildCriteria( ObjectKey pk )
681     {
682         Criteria criteria = new Criteria();
683               criteria.add(ACTIVITY_ID, pk);
684           return criteria;
685      }
686
687     /** Build a Criteria object from the data object for this peer */
688     public static Criteria buildCriteria( Activity obj )
689     {
690         Criteria criteria = new Criteria(DATABASE_NAME);
691               if (!obj.isNew())
692             criteria.add(ACTIVITY_ID, obj.getActivityId());
693               criteria.add(ISSUE_ID, obj.getIssueId());
694               criteria.add(ATTRIBUTE_ID, obj.getAttributeId());
695               criteria.add(TRANSACTION_ID, obj.getTransactionId());
696               criteria.add(OLD_NUMERIC_VALUE, obj.getOldNumericValue());
697               criteria.add(NEW_NUMERIC_VALUE, obj.getNewNumericValue());
698               criteria.add(OLD_USER_ID, obj.getOldUserId());
699               criteria.add(NEW_USER_ID, obj.getNewUserId());
700               criteria.add(OLD_OPTION_ID, obj.getOldOptionId());
701               criteria.add(NEW_OPTION_ID, obj.getNewOptionId());
702               criteria.add(OLD_VALUE, obj.getOldValue());
703               criteria.add(NEW_VALUE, obj.getNewValue());
704               criteria.add(DEPEND_ID, obj.getDependId());
705               criteria.add(DESCRIPTION, obj.getDescription());
706               criteria.add(END_DATE, obj.getEndDate());
707               criteria.add(ATTACHMENT_ID, obj.getAttachmentId());
708           return criteria;
709     }
710
711     /** Build a Criteria object from the data object for this peer, skipping all binary columns */
712     public static Criteria buildSelectCriteria( Activity obj )
713     {
714         Criteria criteria = new Criteria(DATABASE_NAME);
715               if (!obj.isNew())
716                     criteria.add(ACTIVITY_ID, obj.getActivityId());
717                           criteria.add(ISSUE_ID, obj.getIssueId());
718                           criteria.add(ATTRIBUTE_ID, obj.getAttributeId());
719                           criteria.add(TRANSACTION_ID, obj.getTransactionId());
720                           criteria.add(OLD_NUMERIC_VALUE, obj.getOldNumericValue());
721                           criteria.add(NEW_NUMERIC_VALUE, obj.getNewNumericValue());
722                           criteria.add(OLD_USER_ID, obj.getOldUserId());
723                           criteria.add(NEW_USER_ID, obj.getNewUserId());
724                           criteria.add(OLD_OPTION_ID, obj.getOldOptionId());
725                           criteria.add(NEW_OPTION_ID, obj.getNewOptionId());
726                           criteria.add(OLD_VALUE, obj.getOldValue());
727                           criteria.add(NEW_VALUE, obj.getNewValue());
728                           criteria.add(DEPEND_ID, obj.getDependId());
729                           criteria.add(DESCRIPTION, obj.getDescription());
730                           criteria.add(END_DATE, obj.getEndDate());
731                           criteria.add(ATTACHMENT_ID, obj.getAttachmentId());
732               return criteria;
733     }
734  
735     
736         /**
737      * Retrieve a single object by pk
738      *
739      * @param pk the primary key
740      * @throws TorqueException Any exceptions caught during processing will be
741      * rethrown wrapped into a TorqueException.
742      * @throws NoRowsException Primary key was not found in database.
743      * @throws TooManyRowsException Primary key was not found in database.
744      */

745     public static Activity retrieveByPK(Long JavaDoc pk)
746         throws TorqueException, NoRowsException, TooManyRowsException
747     {
748         return retrieveByPK(SimpleKey.keyFor(pk));
749     }
750
751     /**
752      * Retrieve a single object by pk
753      *
754      * @param pk the primary key
755      * @param con the connection to use
756      * @throws TorqueException Any exceptions caught during processing will be
757      * rethrown wrapped into a TorqueException.
758      * @throws NoRowsException Primary key was not found in database.
759      * @throws TooManyRowsException Primary key was not found in database.
760      */

761     public static Activity retrieveByPK(Long JavaDoc pk, Connection JavaDoc con)
762         throws TorqueException, NoRowsException, TooManyRowsException
763     {
764         return retrieveByPK(SimpleKey.keyFor(pk), con);
765     }
766   
767     /**
768      * Retrieve a single object by pk
769      *
770      * @param pk the primary key
771      * @throws TorqueException Any exceptions caught during processing will be
772      * rethrown wrapped into a TorqueException.
773      * @throws NoRowsException Primary key was not found in database.
774      * @throws TooManyRowsException Primary key was not found in database.
775      */

776     public static Activity retrieveByPK(ObjectKey pk)
777         throws TorqueException, NoRowsException, TooManyRowsException
778     {
779         Connection JavaDoc db = null;
780         Activity retVal = null;
781         try
782         {
783             db = Torque.getConnection(DATABASE_NAME);
784             retVal = retrieveByPK(pk, db);
785         }
786         finally
787         {
788             Torque.closeConnection(db);
789         }
790         return(retVal);
791     }
792
793     /**
794      * Retrieve a single object by pk
795      *
796      * @param pk the primary key
797      * @param con the connection to use
798      * @throws TorqueException Any exceptions caught during processing will be
799      * rethrown wrapped into a TorqueException.
800      * @throws NoRowsException Primary key was not found in database.
801      * @throws TooManyRowsException Primary key was not found in database.
802      */

803     public static Activity retrieveByPK(ObjectKey pk, Connection JavaDoc con)
804         throws TorqueException, NoRowsException, TooManyRowsException
805     {
806         Criteria criteria = buildCriteria(pk);
807         List JavaDoc v = doSelect(criteria, con);
808         if (v.size() == 0)
809         {
810             throw new NoRowsException("Failed to select a row.");
811         }
812         else if (v.size() > 1)
813         {
814             throw new TooManyRowsException("Failed to select only one row.");
815         }
816         else
817         {
818             return (Activity)v.get(0);
819         }
820     }
821
822     /**
823      * Retrieve a multiple objects by pk
824      *
825      * @param pks List of primary keys
826      * @throws TorqueException Any exceptions caught during processing will be
827      * rethrown wrapped into a TorqueException.
828      */

829     public static List JavaDoc retrieveByPKs(List JavaDoc pks)
830         throws TorqueException
831     {
832         Connection JavaDoc db = null;
833         List JavaDoc retVal = null;
834         try
835         {
836            db = Torque.getConnection(DATABASE_NAME);
837            retVal = retrieveByPKs(pks, db);
838         }
839         finally
840         {
841             Torque.closeConnection(db);
842         }
843         return(retVal);
844     }
845
846     /**
847      * Retrieve a multiple objects by pk
848      *
849      * @param pks List of primary keys
850      * @param dbcon the connection to use
851      * @throws TorqueException Any exceptions caught during processing will be
852      * rethrown wrapped into a TorqueException.
853      */

854     public static List JavaDoc retrieveByPKs( List JavaDoc pks, Connection JavaDoc dbcon )
855         throws TorqueException
856     {
857         List JavaDoc objs = null;
858         if (pks == null || pks.size() == 0)
859         {
860             objs = new LinkedList JavaDoc();
861         }
862         else
863         {
864             Criteria criteria = new Criteria();
865               criteria.addIn( ACTIVITY_ID, pks );
866           objs = doSelect(criteria, dbcon);
867         }
868         return objs;
869     }
870
871  
872
873
874
875                           
876                                               
877                 
878                 
879
880     /**
881      * selects a collection of Activity objects pre-filled with their
882      * Issue objects.
883      *
884      * This method is protected by default in order to keep the public
885      * api reasonable. You can provide public methods for those you
886      * actually need in ActivityPeer.
887      *
888      * @throws TorqueException Any exceptions caught during processing will be
889      * rethrown wrapped into a TorqueException.
890      */

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

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

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

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

1151    protected static List JavaDoc doSelectJoinScarabUserImplRelatedByNewUserId(Criteria criteria)
1152        throws TorqueException
1153    {
1154        setDbName(criteria);
1155
1156        ActivityPeer.addSelectColumns(criteria);
1157        int offset = numColumns + 1;
1158        ScarabUserImplPeer.addSelectColumns(criteria);
1159
1160
1161                        criteria.addJoin(ActivityPeer.NEW_USER_ID,
1162            ScarabUserImplPeer.USER_ID);
1163        
1164
1165                                                                                                                                                                                                                                                                                                        
1166        List JavaDoc rows = BasePeer.doSelect(criteria);
1167        List JavaDoc results = new ArrayList JavaDoc();
1168
1169        for (int i = 0; i < rows.size(); i++)
1170        {
1171            Record row = (Record) rows.get(i);
1172
1173                            Class JavaDoc omClass = ActivityPeer.getOMClass();
1174                    Activity obj1 = (Activity) ActivityPeer
1175                .row2Object(row, 1, omClass);
1176                     omClass = ScarabUserImplPeer.getOMClass();
1177                    ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
1178                .row2Object(row, offset, omClass);
1179
1180            boolean newObject = true;
1181            for (int j = 0; j < results.size(); j++)
1182            {
1183                Activity temp_obj1 = (Activity)results.get(j);
1184                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
1185                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1186                {
1187                    newObject = false;
1188                              temp_obj2.addActivityRelatedByNewUserId(obj1);
1189                              break;
1190                }
1191            }
1192                      if (newObject)
1193            {
1194                obj2.initActivitysRelatedByNewUserId();
1195                obj2.addActivityRelatedByNewUserId(obj1);
1196            }
1197                      results.add(obj1);
1198        }
1199        return results;
1200    }
1201                                                                      
1202                
1203                
1204
1205    /**
1206     * selects a collection of Activity objects pre-filled with their
1207     * AttributeOption objects.
1208     *
1209     * This method is protected by default in order to keep the public
1210     * api reasonable. You can provide public methods for those you
1211     * actually need in ActivityPeer.
1212     *
1213     * @throws TorqueException Any exceptions caught during processing will be
1214     * rethrown wrapped into a TorqueException.
1215     */

1216    protected static List JavaDoc doSelectJoinAttributeOptionRelatedByOldOptionId(Criteria criteria)
1217        throws TorqueException
1218    {
1219        setDbName(criteria);
1220
1221        ActivityPeer.addSelectColumns(criteria);
1222        int offset = numColumns + 1;
1223        AttributeOptionPeer.addSelectColumns(criteria);
1224
1225
1226                        criteria.addJoin(ActivityPeer.OLD_OPTION_ID,
1227            AttributeOptionPeer.OPTION_ID);
1228        
1229
1230                                                                                                                                                                                                                                                                                                        
1231        List JavaDoc rows = BasePeer.doSelect(criteria);
1232        List JavaDoc results = new ArrayList JavaDoc();
1233
1234        for (int i = 0; i < rows.size(); i++)
1235        {
1236            Record row = (Record) rows.get(i);
1237
1238                            Class JavaDoc omClass = ActivityPeer.getOMClass();
1239                    Activity obj1 = (Activity) ActivityPeer
1240                .row2Object(row, 1, omClass);
1241                     omClass = AttributeOptionPeer.getOMClass();
1242                    AttributeOption obj2 = (AttributeOption)AttributeOptionPeer
1243                .row2Object(row, offset, omClass);
1244
1245            boolean newObject = true;
1246            for (int j = 0; j < results.size(); j++)
1247            {
1248                Activity temp_obj1 = (Activity)results.get(j);
1249                AttributeOption temp_obj2 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
1250                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1251                {
1252                    newObject = false;
1253                              temp_obj2.addActivityRelatedByOldOptionId(obj1);
1254                              break;
1255                }
1256            }
1257                      if (newObject)
1258            {
1259                obj2.initActivitysRelatedByOldOptionId();
1260                obj2.addActivityRelatedByOldOptionId(obj1);
1261            }
1262                      results.add(obj1);
1263        }
1264        return results;
1265    }
1266                                                                      
1267                
1268                
1269
1270    /**
1271     * selects a collection of Activity objects pre-filled with their
1272     * AttributeOption objects.
1273     *
1274     * This method is protected by default in order to keep the public
1275     * api reasonable. You can provide public methods for those you
1276     * actually need in ActivityPeer.
1277     *
1278     * @throws TorqueException Any exceptions caught during processing will be
1279     * rethrown wrapped into a TorqueException.
1280     */

1281    protected static List JavaDoc doSelectJoinAttributeOptionRelatedByNewOptionId(Criteria criteria)
1282        throws TorqueException
1283    {
1284        setDbName(criteria);
1285
1286        ActivityPeer.addSelectColumns(criteria);
1287        int offset = numColumns + 1;
1288        AttributeOptionPeer.addSelectColumns(criteria);
1289
1290
1291                        criteria.addJoin(ActivityPeer.NEW_OPTION_ID,
1292            AttributeOptionPeer.OPTION_ID);
1293        
1294
1295                                                                                                                                                                                                                                                                                                        
1296        List JavaDoc rows = BasePeer.doSelect(criteria);
1297        List JavaDoc results = new ArrayList JavaDoc();
1298
1299        for (int i = 0; i < rows.size(); i++)
1300        {
1301            Record row = (Record) rows.get(i);
1302
1303                            Class JavaDoc omClass = ActivityPeer.getOMClass();
1304                    Activity obj1 = (Activity) ActivityPeer
1305                .row2Object(row, 1, omClass);
1306                     omClass = AttributeOptionPeer.getOMClass();
1307                    AttributeOption obj2 = (AttributeOption)AttributeOptionPeer
1308                .row2Object(row, offset, omClass);
1309
1310            boolean newObject = true;
1311            for (int j = 0; j < results.size(); j++)
1312            {
1313                Activity temp_obj1 = (Activity)results.get(j);
1314                AttributeOption temp_obj2 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
1315                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1316                {
1317                    newObject = false;
1318                              temp_obj2.addActivityRelatedByNewOptionId(obj1);
1319                              break;
1320                }
1321            }
1322                      if (newObject)
1323            {
1324                obj2.initActivitysRelatedByNewOptionId();
1325                obj2.addActivityRelatedByNewOptionId(obj1);
1326            }
1327                      results.add(obj1);
1328        }
1329        return results;
1330    }
1331                                                            
1332                
1333                
1334
1335    /**
1336     * selects a collection of Activity objects pre-filled with their
1337     * Attachment objects.
1338     *
1339     * This method is protected by default in order to keep the public
1340     * api reasonable. You can provide public methods for those you
1341     * actually need in ActivityPeer.
1342     *
1343     * @throws TorqueException Any exceptions caught during processing will be
1344     * rethrown wrapped into a TorqueException.
1345     */

1346    protected static List JavaDoc doSelectJoinAttachment(Criteria criteria)
1347        throws TorqueException
1348    {
1349        setDbName(criteria);
1350
1351        ActivityPeer.addSelectColumns(criteria);
1352        int offset = numColumns + 1;
1353        AttachmentPeer.addSelectColumns(criteria);
1354
1355
1356                        criteria.addJoin(ActivityPeer.ATTACHMENT_ID,
1357            AttachmentPeer.ATTACHMENT_ID);
1358        
1359
1360                                                                                                                                                                                                                                                                                                        
1361        List JavaDoc rows = BasePeer.doSelect(criteria);
1362        List JavaDoc results = new ArrayList JavaDoc();
1363
1364        for (int i = 0; i < rows.size(); i++)
1365        {
1366            Record row = (Record) rows.get(i);
1367
1368                            Class JavaDoc omClass = ActivityPeer.getOMClass();
1369                    Activity obj1 = (Activity) ActivityPeer
1370                .row2Object(row, 1, omClass);
1371                     omClass = AttachmentPeer.getOMClass();
1372                    Attachment obj2 = (Attachment)AttachmentPeer
1373                .row2Object(row, offset, omClass);
1374
1375            boolean newObject = true;
1376            for (int j = 0; j < results.size(); j++)
1377            {
1378                Activity temp_obj1 = (Activity)results.get(j);
1379                Attachment temp_obj2 = (Attachment)temp_obj1.getAttachment();
1380                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1381                {
1382                    newObject = false;
1383                              temp_obj2.addActivity(obj1);
1384                              break;
1385                }
1386            }
1387                      if (newObject)
1388            {
1389                obj2.initActivitys();
1390                obj2.addActivity(obj1);
1391            }
1392                      results.add(obj1);
1393        }
1394        return results;
1395    }
1396                                                            
1397                
1398                
1399
1400    /**
1401     * selects a collection of Activity objects pre-filled with their
1402     * Depend objects.
1403     *
1404     * This method is protected by default in order to keep the public
1405     * api reasonable. You can provide public methods for those you
1406     * actually need in ActivityPeer.
1407     *
1408     * @throws TorqueException Any exceptions caught during processing will be
1409     * rethrown wrapped into a TorqueException.
1410     */

1411    protected static List JavaDoc doSelectJoinDepend(Criteria criteria)
1412        throws TorqueException
1413    {
1414        setDbName(criteria);
1415
1416        ActivityPeer.addSelectColumns(criteria);
1417        int offset = numColumns + 1;
1418        DependPeer.addSelectColumns(criteria);
1419
1420
1421                        criteria.addJoin(ActivityPeer.DEPEND_ID,
1422            DependPeer.DEPEND_ID);
1423        
1424
1425                                                                                                                                                                                                                                                                                                        
1426        List JavaDoc rows = BasePeer.doSelect(criteria);
1427        List JavaDoc results = new ArrayList JavaDoc();
1428
1429        for (int i = 0; i < rows.size(); i++)
1430        {
1431            Record row = (Record) rows.get(i);
1432
1433                            Class JavaDoc omClass = ActivityPeer.getOMClass();
1434                    Activity obj1 = (Activity) ActivityPeer
1435                .row2Object(row, 1, omClass);
1436                     omClass = DependPeer.getOMClass();
1437                    Depend obj2 = (Depend)DependPeer
1438                .row2Object(row, offset, omClass);
1439
1440            boolean newObject = true;
1441            for (int j = 0; j < results.size(); j++)
1442            {
1443                Activity temp_obj1 = (Activity)results.get(j);
1444                Depend temp_obj2 = (Depend)temp_obj1.getDepend();
1445                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1446                {
1447                    newObject = false;
1448                              temp_obj2.addActivity(obj1);
1449                              break;
1450                }
1451            }
1452                      if (newObject)
1453            {
1454                obj2.initActivitys();
1455                obj2.addActivity(obj1);
1456            }
1457                      results.add(obj1);
1458        }
1459        return results;
1460    }
1461                    
1462  
1463                                                                                                
1464          
1465        
1466                                  
1467                
1468
1469    /**
1470     * selects a collection of Activity objects pre-filled with
1471     * all related objects.
1472     *
1473     * This method is protected by default in order to keep the public
1474     * api reasonable. You can provide public methods for those you
1475     * actually need in ActivityPeer.
1476     *
1477     * @throws TorqueException Any exceptions caught during processing will be
1478     * rethrown wrapped into a TorqueException.
1479     */

1480    protected static List JavaDoc doSelectJoinAllExceptIssue(Criteria criteria)
1481        throws TorqueException
1482    {
1483        setDbName(criteria);
1484
1485        addSelectColumns(criteria);
1486        int offset2 = numColumns + 1;
1487                                    
1488                                                  
1489                    AttributePeer.addSelectColumns(criteria);
1490        int offset3 = offset2 + AttributePeer.numColumns;
1491                                                                
1492                    ActivitySetPeer.addSelectColumns(criteria);
1493        int offset4 = offset3 + ActivitySetPeer.numColumns;
1494                                                                
1495                    ScarabUserImplPeer.addSelectColumns(criteria);
1496        int offset5 = offset4 + ScarabUserImplPeer.numColumns;
1497                                                                
1498                    ScarabUserImplPeer.addSelectColumns(criteria);
1499        int offset6 = offset5 + ScarabUserImplPeer.numColumns;
1500                                                                
1501                    AttributeOptionPeer.addSelectColumns(criteria);
1502        int offset7 = offset6 + AttributeOptionPeer.numColumns;
1503                                                                
1504                    AttributeOptionPeer.addSelectColumns(criteria);
1505        int offset8 = offset7 + AttributeOptionPeer.numColumns;
1506                                                                
1507                    AttachmentPeer.addSelectColumns(criteria);
1508        int offset9 = offset8 + AttachmentPeer.numColumns;
1509                                                                
1510                    DependPeer.addSelectColumns(criteria);
1511        int offset10 = offset9 + DependPeer.numColumns;
1512                                                                                                                                                                                                                                                                                                                                                    
1513        List JavaDoc rows = BasePeer.doSelect(criteria);
1514        List JavaDoc results = new ArrayList JavaDoc();
1515
1516        for (int i = 0; i < rows.size(); i++)
1517        {
1518            Record row = (Record)rows.get(i);
1519
1520                            Class JavaDoc omClass = ActivityPeer.getOMClass();
1521                    Activity obj1 = (Activity)ActivityPeer
1522                .row2Object(row, 1, omClass);
1523                                                
1524                                                                  
1525                                                        
1526                            
1527              
1528                           omClass = AttributePeer.getOMClass();
1529                          Attribute obj2 = (Attribute)AttributePeer
1530                .row2Object( row, offset2, omClass);
1531
1532               boolean newObject = true;
1533            for (int j = 0; j < results.size(); j++)
1534            {
1535                Activity temp_obj1 = (Activity)results.get(j);
1536                Attribute temp_obj2 = (Attribute)temp_obj1.getAttribute();
1537                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1538                {
1539                    newObject = false;
1540                                    temp_obj2.addActivity(obj1);
1541                                    break;
1542                }
1543            }
1544                            if (newObject)
1545            {
1546                obj2.initActivitys();
1547                obj2.addActivity(obj1);
1548            }
1549                                                                                    
1550                                                        
1551                            
1552              
1553                           omClass = ActivitySetPeer.getOMClass();
1554                          ActivitySet obj3 = (ActivitySet)ActivitySetPeer
1555                .row2Object( row, offset3, omClass);
1556
1557               newObject = true;
1558            for (int j = 0; j < results.size(); j++)
1559            {
1560                Activity temp_obj1 = (Activity)results.get(j);
1561                ActivitySet temp_obj3 = (ActivitySet)temp_obj1.getActivitySet();
1562                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1563                {
1564                    newObject = false;
1565                                    temp_obj3.addActivity(obj1);
1566                                    break;
1567                }
1568            }
1569                            if (newObject)
1570            {
1571                obj3.initActivitys();
1572                obj3.addActivity(obj1);
1573            }
1574                                                                                                
1575                                                                        
1576                            
1577              
1578                           omClass = ScarabUserImplPeer.getOMClass();
1579                          ScarabUserImpl obj4 = (ScarabUserImpl)ScarabUserImplPeer
1580                .row2Object( row, offset4, omClass);
1581
1582               newObject = true;
1583            for (int j = 0; j < results.size(); j++)
1584            {
1585                Activity temp_obj1 = (Activity)results.get(j);
1586                ScarabUserImpl temp_obj4 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOldUserId();
1587                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1588                {
1589                    newObject = false;
1590                                    temp_obj4.addActivityRelatedByOldUserId(obj1);
1591                                    break;
1592                }
1593            }
1594                            if (newObject)
1595            {
1596                obj4.initActivitysRelatedByOldUserId();
1597                obj4.addActivityRelatedByOldUserId(obj1);
1598            }
1599                                                                                                
1600                                                                        
1601                            
1602              
1603                           omClass = ScarabUserImplPeer.getOMClass();
1604                          ScarabUserImpl obj5 = (ScarabUserImpl)ScarabUserImplPeer
1605                .row2Object( row, offset5, omClass);
1606
1607               newObject = true;
1608            for (int j = 0; j < results.size(); j++)
1609            {
1610                Activity temp_obj1 = (Activity)results.get(j);
1611                ScarabUserImpl temp_obj5 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
1612                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1613                {
1614                    newObject = false;
1615                                    temp_obj5.addActivityRelatedByNewUserId(obj1);
1616                                    break;
1617                }
1618            }
1619                            if (newObject)
1620            {
1621                obj5.initActivitysRelatedByNewUserId();
1622                obj5.addActivityRelatedByNewUserId(obj1);
1623            }
1624                                                                                    
1625                                                                        
1626                            
1627              
1628                           omClass = AttributeOptionPeer.getOMClass();
1629                          AttributeOption obj6 = (AttributeOption)AttributeOptionPeer
1630                .row2Object( row, offset6, omClass);
1631
1632               newObject = true;
1633            for (int j = 0; j < results.size(); j++)
1634            {
1635                Activity temp_obj1 = (Activity)results.get(j);
1636                AttributeOption temp_obj6 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
1637                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
1638                {
1639                    newObject = false;
1640                                    temp_obj6.addActivityRelatedByOldOptionId(obj1);
1641                                    break;
1642                }
1643            }
1644                            if (newObject)
1645            {
1646                obj6.initActivitysRelatedByOldOptionId();
1647                obj6.addActivityRelatedByOldOptionId(obj1);
1648            }
1649                                                                                    
1650                                                                        
1651                            
1652              
1653                           omClass = AttributeOptionPeer.getOMClass();
1654                          AttributeOption obj7 = (AttributeOption)AttributeOptionPeer
1655                .row2Object( row, offset7, omClass);
1656
1657               newObject = true;
1658            for (int j = 0; j < results.size(); j++)
1659            {
1660                Activity temp_obj1 = (Activity)results.get(j);
1661                AttributeOption temp_obj7 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
1662                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
1663                {
1664                    newObject = false;
1665                                    temp_obj7.addActivityRelatedByNewOptionId(obj1);
1666                                    break;
1667                }
1668            }
1669                            if (newObject)
1670            {
1671                obj7.initActivitysRelatedByNewOptionId();
1672                obj7.addActivityRelatedByNewOptionId(obj1);
1673            }
1674                                                                                    
1675                                                        
1676                            
1677              
1678                           omClass = AttachmentPeer.getOMClass();
1679                          Attachment obj8 = (Attachment)AttachmentPeer
1680                .row2Object( row, offset8, omClass);
1681
1682               newObject = true;
1683            for (int j = 0; j < results.size(); j++)
1684            {
1685                Activity temp_obj1 = (Activity)results.get(j);
1686                Attachment temp_obj8 = (Attachment)temp_obj1.getAttachment();
1687                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
1688                {
1689                    newObject = false;
1690                                    temp_obj8.addActivity(obj1);
1691                                    break;
1692                }
1693            }
1694                            if (newObject)
1695            {
1696                obj8.initActivitys();
1697                obj8.addActivity(obj1);
1698            }
1699                                                                                    
1700                                                        
1701                            
1702              
1703                           omClass = DependPeer.getOMClass();
1704                          Depend obj9 = (Depend)DependPeer
1705                .row2Object( row, offset9, omClass);
1706
1707               newObject = true;
1708            for (int j = 0; j < results.size(); j++)
1709            {
1710                Activity temp_obj1 = (Activity)results.get(j);
1711                Depend temp_obj9 = (Depend)temp_obj1.getDepend();
1712                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
1713                {
1714                    newObject = false;
1715                                    temp_obj9.addActivity(obj1);
1716                                    break;
1717                }
1718            }
1719                            if (newObject)
1720            {
1721                obj9.initActivitys();
1722                obj9.addActivity(obj1);
1723            }
1724                                                                results.add(obj1);
1725        }
1726        return results;
1727    }
1728        
1729        
1730                                  
1731                
1732
1733    /**
1734     * selects a collection of Activity objects pre-filled with
1735     * all related objects.
1736     *
1737     * This method is protected by default in order to keep the public
1738     * api reasonable. You can provide public methods for those you
1739     * actually need in ActivityPeer.
1740     *
1741     * @throws TorqueException Any exceptions caught during processing will be
1742     * rethrown wrapped into a TorqueException.
1743     */

1744    protected static List JavaDoc doSelectJoinAllExceptAttribute(Criteria criteria)
1745        throws TorqueException
1746    {
1747        setDbName(criteria);
1748
1749        addSelectColumns(criteria);
1750        int offset2 = numColumns + 1;
1751                                    
1752                    IssuePeer.addSelectColumns(criteria);
1753        int offset3 = offset2 + IssuePeer.numColumns;
1754                                                                
1755                                                  
1756                    ActivitySetPeer.addSelectColumns(criteria);
1757        int offset4 = offset3 + ActivitySetPeer.numColumns;
1758                                                                
1759                    ScarabUserImplPeer.addSelectColumns(criteria);
1760        int offset5 = offset4 + ScarabUserImplPeer.numColumns;
1761                                                                
1762                    ScarabUserImplPeer.addSelectColumns(criteria);
1763        int offset6 = offset5 + ScarabUserImplPeer.numColumns;
1764                                                                
1765                    AttributeOptionPeer.addSelectColumns(criteria);
1766        int offset7 = offset6 + AttributeOptionPeer.numColumns;
1767                                                                
1768                    AttributeOptionPeer.addSelectColumns(criteria);
1769        int offset8 = offset7 + AttributeOptionPeer.numColumns;
1770                                                                
1771                    AttachmentPeer.addSelectColumns(criteria);
1772        int offset9 = offset8 + AttachmentPeer.numColumns;
1773                                                                
1774                    DependPeer.addSelectColumns(criteria);
1775        int offset10 = offset9 + DependPeer.numColumns;
1776                                                                                                                                                                                                                                                                                                                                                    
1777        List JavaDoc rows = BasePeer.doSelect(criteria);
1778        List JavaDoc results = new ArrayList JavaDoc();
1779
1780        for (int i = 0; i < rows.size(); i++)
1781        {
1782            Record row = (Record)rows.get(i);
1783
1784                            Class JavaDoc omClass = ActivityPeer.getOMClass();
1785                    Activity obj1 = (Activity)ActivityPeer
1786                .row2Object(row, 1, omClass);
1787                                                
1788                                                        
1789                            
1790              
1791                           omClass = IssuePeer.getOMClass();
1792                          Issue obj2 = (Issue)IssuePeer
1793                .row2Object( row, offset2, omClass);
1794
1795               boolean newObject = true;
1796            for (int j = 0; j < results.size(); j++)
1797            {
1798                Activity temp_obj1 = (Activity)results.get(j);
1799                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
1800                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1801                {
1802                    newObject = false;
1803                                    temp_obj2.addActivity(obj1);
1804                                    break;
1805                }
1806            }
1807                            if (newObject)
1808            {
1809                obj2.initActivitys();
1810                obj2.addActivity(obj1);
1811            }
1812                                                                                    
1813                                                                  
1814                                                        
1815                            
1816              
1817                           omClass = ActivitySetPeer.getOMClass();
1818                          ActivitySet obj3 = (ActivitySet)ActivitySetPeer
1819                .row2Object( row, offset3, omClass);
1820
1821               newObject = true;
1822            for (int j = 0; j < results.size(); j++)
1823            {
1824                Activity temp_obj1 = (Activity)results.get(j);
1825                ActivitySet temp_obj3 = (ActivitySet)temp_obj1.getActivitySet();
1826                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1827                {
1828                    newObject = false;
1829                                    temp_obj3.addActivity(obj1);
1830                                    break;
1831                }
1832            }
1833                            if (newObject)
1834            {
1835                obj3.initActivitys();
1836                obj3.addActivity(obj1);
1837            }
1838                                                                                                
1839                                                                        
1840                            
1841              
1842                           omClass = ScarabUserImplPeer.getOMClass();
1843                          ScarabUserImpl obj4 = (ScarabUserImpl)ScarabUserImplPeer
1844                .row2Object( row, offset4, omClass);
1845
1846               newObject = true;
1847            for (int j = 0; j < results.size(); j++)
1848            {
1849                Activity temp_obj1 = (Activity)results.get(j);
1850                ScarabUserImpl temp_obj4 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOldUserId();
1851                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1852                {
1853                    newObject = false;
1854                                    temp_obj4.addActivityRelatedByOldUserId(obj1);
1855                                    break;
1856                }
1857            }
1858                            if (newObject)
1859            {
1860                obj4.initActivitysRelatedByOldUserId();
1861                obj4.addActivityRelatedByOldUserId(obj1);
1862            }
1863                                                                                                
1864                                                                        
1865                            
1866              
1867                           omClass = ScarabUserImplPeer.getOMClass();
1868                          ScarabUserImpl obj5 = (ScarabUserImpl)ScarabUserImplPeer
1869                .row2Object( row, offset5, omClass);
1870
1871               newObject = true;
1872            for (int j = 0; j < results.size(); j++)
1873            {
1874                Activity temp_obj1 = (Activity)results.get(j);
1875                ScarabUserImpl temp_obj5 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
1876                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1877                {
1878                    newObject = false;
1879                                    temp_obj5.addActivityRelatedByNewUserId(obj1);
1880                                    break;
1881                }
1882            }
1883                            if (newObject)
1884            {
1885                obj5.initActivitysRelatedByNewUserId();
1886                obj5.addActivityRelatedByNewUserId(obj1);
1887            }
1888                                                                                    
1889                                                                        
1890                            
1891              
1892                           omClass = AttributeOptionPeer.getOMClass();
1893                          AttributeOption obj6 = (AttributeOption)AttributeOptionPeer
1894                .row2Object( row, offset6, omClass);
1895
1896               newObject = true;
1897            for (int j = 0; j < results.size(); j++)
1898            {
1899                Activity temp_obj1 = (Activity)results.get(j);
1900                AttributeOption temp_obj6 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
1901                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
1902                {
1903                    newObject = false;
1904                                    temp_obj6.addActivityRelatedByOldOptionId(obj1);
1905                                    break;
1906                }
1907            }
1908                            if (newObject)
1909            {
1910                obj6.initActivitysRelatedByOldOptionId();
1911                obj6.addActivityRelatedByOldOptionId(obj1);
1912            }
1913                                                                                    
1914                                                                        
1915                            
1916              
1917                           omClass = AttributeOptionPeer.getOMClass();
1918                          AttributeOption obj7 = (AttributeOption)AttributeOptionPeer
1919                .row2Object( row, offset7, omClass);
1920
1921               newObject = true;
1922            for (int j = 0; j < results.size(); j++)
1923            {
1924                Activity temp_obj1 = (Activity)results.get(j);
1925                AttributeOption temp_obj7 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
1926                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
1927                {
1928                    newObject = false;
1929                                    temp_obj7.addActivityRelatedByNewOptionId(obj1);
1930                                    break;
1931                }
1932            }
1933                            if (newObject)
1934            {
1935                obj7.initActivitysRelatedByNewOptionId();
1936                obj7.addActivityRelatedByNewOptionId(obj1);
1937            }
1938                                                                                    
1939                                                        
1940                            
1941              
1942                           omClass = AttachmentPeer.getOMClass();
1943                          Attachment obj8 = (Attachment)AttachmentPeer
1944                .row2Object( row, offset8, omClass);
1945
1946               newObject = true;
1947            for (int j = 0; j < results.size(); j++)
1948            {
1949                Activity temp_obj1 = (Activity)results.get(j);
1950                Attachment temp_obj8 = (Attachment)temp_obj1.getAttachment();
1951                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
1952                {
1953                    newObject = false;
1954                                    temp_obj8.addActivity(obj1);
1955                                    break;
1956                }
1957            }
1958                            if (newObject)
1959            {
1960                obj8.initActivitys();
1961                obj8.addActivity(obj1);
1962            }
1963                                                                                    
1964                                                        
1965                            
1966              
1967                           omClass = DependPeer.getOMClass();
1968                          Depend obj9 = (Depend)DependPeer
1969                .row2Object( row, offset9, omClass);
1970
1971               newObject = true;
1972            for (int j = 0; j < results.size(); j++)
1973            {
1974                Activity temp_obj1 = (Activity)results.get(j);
1975                Depend temp_obj9 = (Depend)temp_obj1.getDepend();
1976                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
1977                {
1978                    newObject = false;
1979                                    temp_obj9.addActivity(obj1);
1980                                    break;
1981                }
1982            }
1983                            if (newObject)
1984            {
1985                obj9.initActivitys();
1986                obj9.addActivity(obj1);
1987            }
1988                                                                results.add(obj1);
1989        }
1990        return results;
1991    }
1992        
1993        
1994                                  
1995                
1996
1997    /**
1998     * selects a collection of Activity objects pre-filled with
1999     * all related objects.
2000     *
2001     * This method is protected by default in order to keep the public
2002     * api reasonable. You can provide public methods for those you
2003     * actually need in ActivityPeer.
2004     *
2005     * @throws TorqueException Any exceptions caught during processing will be
2006     * rethrown wrapped into a TorqueException.
2007     */

2008    protected static List JavaDoc doSelectJoinAllExceptActivitySet(Criteria criteria)
2009        throws TorqueException
2010    {
2011        setDbName(criteria);
2012
2013        addSelectColumns(criteria);
2014        int offset2 = numColumns + 1;
2015                                    
2016                    IssuePeer.addSelectColumns(criteria);
2017        int offset3 = offset2 + IssuePeer.numColumns;
2018                                                                
2019                    AttributePeer.addSelectColumns(criteria);
2020        int offset4 = offset3 + AttributePeer.numColumns;
2021                                                                
2022                                                  
2023                    ScarabUserImplPeer.addSelectColumns(criteria);
2024        int offset5 = offset4 + ScarabUserImplPeer.numColumns;
2025                                                                
2026                    ScarabUserImplPeer.addSelectColumns(criteria);
2027        int offset6 = offset5 + ScarabUserImplPeer.numColumns;
2028                                                                
2029                    AttributeOptionPeer.addSelectColumns(criteria);
2030        int offset7 = offset6 + AttributeOptionPeer.numColumns;
2031                                                                
2032                    AttributeOptionPeer.addSelectColumns(criteria);
2033        int offset8 = offset7 + AttributeOptionPeer.numColumns;
2034                                                                
2035                    AttachmentPeer.addSelectColumns(criteria);
2036        int offset9 = offset8 + AttachmentPeer.numColumns;
2037                                                                
2038                    DependPeer.addSelectColumns(criteria);
2039        int offset10 = offset9 + DependPeer.numColumns;
2040                                                                                                                                                                                                                                                                                                                                                    
2041        List JavaDoc rows = BasePeer.doSelect(criteria);
2042        List JavaDoc results = new ArrayList JavaDoc();
2043
2044        for (int i = 0; i < rows.size(); i++)
2045        {
2046            Record row = (Record)rows.get(i);
2047
2048                            Class JavaDoc omClass = ActivityPeer.getOMClass();
2049                    Activity obj1 = (Activity)ActivityPeer
2050                .row2Object(row, 1, omClass);
2051                                                
2052                                                        
2053                            
2054              
2055                           omClass = IssuePeer.getOMClass();
2056                          Issue obj2 = (Issue)IssuePeer
2057                .row2Object( row, offset2, omClass);
2058
2059               boolean newObject = true;
2060            for (int j = 0; j < results.size(); j++)
2061            {
2062                Activity temp_obj1 = (Activity)results.get(j);
2063                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
2064                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2065                {
2066                    newObject = false;
2067                                    temp_obj2.addActivity(obj1);
2068                                    break;
2069                }
2070            }
2071                            if (newObject)
2072            {
2073                obj2.initActivitys();
2074                obj2.addActivity(obj1);
2075            }
2076                                                                                    
2077                                                        
2078                            
2079              
2080                           omClass = AttributePeer.getOMClass();
2081                          Attribute obj3 = (Attribute)AttributePeer
2082                .row2Object( row, offset3, omClass);
2083
2084               newObject = true;
2085            for (int j = 0; j < results.size(); j++)
2086            {
2087                Activity temp_obj1 = (Activity)results.get(j);
2088                Attribute temp_obj3 = (Attribute)temp_obj1.getAttribute();
2089                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2090                {
2091                    newObject = false;
2092                                    temp_obj3.addActivity(obj1);
2093                                    break;
2094                }
2095            }
2096                            if (newObject)
2097            {
2098                obj3.initActivitys();
2099                obj3.addActivity(obj1);
2100            }
2101                                                                                    
2102                                                                              
2103                                                                        
2104                            
2105              
2106                           omClass = ScarabUserImplPeer.getOMClass();
2107                          ScarabUserImpl obj4 = (ScarabUserImpl)ScarabUserImplPeer
2108                .row2Object( row, offset4, omClass);
2109
2110               newObject = true;
2111            for (int j = 0; j < results.size(); j++)
2112            {
2113                Activity temp_obj1 = (Activity)results.get(j);
2114                ScarabUserImpl temp_obj4 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOldUserId();
2115                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2116                {
2117                    newObject = false;
2118                                    temp_obj4.addActivityRelatedByOldUserId(obj1);
2119                                    break;
2120                }
2121            }
2122                            if (newObject)
2123            {
2124                obj4.initActivitysRelatedByOldUserId();
2125                obj4.addActivityRelatedByOldUserId(obj1);
2126            }
2127                                                                                                
2128                                                                        
2129                            
2130              
2131                           omClass = ScarabUserImplPeer.getOMClass();
2132                          ScarabUserImpl obj5 = (ScarabUserImpl)ScarabUserImplPeer
2133                .row2Object( row, offset5, omClass);
2134
2135               newObject = true;
2136            for (int j = 0; j < results.size(); j++)
2137            {
2138                Activity temp_obj1 = (Activity)results.get(j);
2139                ScarabUserImpl temp_obj5 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
2140                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2141                {
2142                    newObject = false;
2143                                    temp_obj5.addActivityRelatedByNewUserId(obj1);
2144                                    break;
2145                }
2146            }
2147                            if (newObject)
2148            {
2149                obj5.initActivitysRelatedByNewUserId();
2150                obj5.addActivityRelatedByNewUserId(obj1);
2151            }
2152                                                                                    
2153                                                                        
2154                            
2155              
2156                           omClass = AttributeOptionPeer.getOMClass();
2157                          AttributeOption obj6 = (AttributeOption)AttributeOptionPeer
2158                .row2Object( row, offset6, omClass);
2159
2160               newObject = true;
2161            for (int j = 0; j < results.size(); j++)
2162            {
2163                Activity temp_obj1 = (Activity)results.get(j);
2164                AttributeOption temp_obj6 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
2165                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2166                {
2167                    newObject = false;
2168                                    temp_obj6.addActivityRelatedByOldOptionId(obj1);
2169                                    break;
2170                }
2171            }
2172                            if (newObject)
2173            {
2174                obj6.initActivitysRelatedByOldOptionId();
2175                obj6.addActivityRelatedByOldOptionId(obj1);
2176            }
2177                                                                                    
2178                                                                        
2179                            
2180              
2181                           omClass = AttributeOptionPeer.getOMClass();
2182                          AttributeOption obj7 = (AttributeOption)AttributeOptionPeer
2183                .row2Object( row, offset7, omClass);
2184
2185               newObject = true;
2186            for (int j = 0; j < results.size(); j++)
2187            {
2188                Activity temp_obj1 = (Activity)results.get(j);
2189                AttributeOption temp_obj7 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
2190                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
2191                {
2192                    newObject = false;
2193                                    temp_obj7.addActivityRelatedByNewOptionId(obj1);
2194                                    break;
2195                }
2196            }
2197                            if (newObject)
2198            {
2199                obj7.initActivitysRelatedByNewOptionId();
2200                obj7.addActivityRelatedByNewOptionId(obj1);
2201            }
2202                                                                                    
2203                                                        
2204                            
2205              
2206                           omClass = AttachmentPeer.getOMClass();
2207                          Attachment obj8 = (Attachment)AttachmentPeer
2208                .row2Object( row, offset8, omClass);
2209
2210               newObject = true;
2211            for (int j = 0; j < results.size(); j++)
2212            {
2213                Activity temp_obj1 = (Activity)results.get(j);
2214                Attachment temp_obj8 = (Attachment)temp_obj1.getAttachment();
2215                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
2216                {
2217                    newObject = false;
2218                                    temp_obj8.addActivity(obj1);
2219                                    break;
2220                }
2221            }
2222                            if (newObject)
2223            {
2224                obj8.initActivitys();
2225                obj8.addActivity(obj1);
2226            }
2227                                                                                    
2228                                                        
2229                            
2230              
2231                           omClass = DependPeer.getOMClass();
2232                          Depend obj9 = (Depend)DependPeer
2233                .row2Object( row, offset9, omClass);
2234
2235               newObject = true;
2236            for (int j = 0; j < results.size(); j++)
2237            {
2238                Activity temp_obj1 = (Activity)results.get(j);
2239                Depend temp_obj9 = (Depend)temp_obj1.getDepend();
2240                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
2241                {
2242                    newObject = false;
2243                                    temp_obj9.addActivity(obj1);
2244                                    break;
2245                }
2246            }
2247                            if (newObject)
2248            {
2249                obj9.initActivitys();
2250                obj9.addActivity(obj1);
2251            }
2252                                                                results.add(obj1);
2253        }
2254        return results;
2255    }
2256        
2257        
2258                                            
2259                
2260
2261    /**
2262     * selects a collection of Activity objects pre-filled with
2263     * all related objects.
2264     *
2265     * This method is protected by default in order to keep the public
2266     * api reasonable. You can provide public methods for those you
2267     * actually need in ActivityPeer.
2268     *
2269     * @throws TorqueException Any exceptions caught during processing will be
2270     * rethrown wrapped into a TorqueException.
2271     */

2272    protected static List JavaDoc doSelectJoinAllExceptScarabUserImplRelatedByOldUserId(Criteria criteria)
2273        throws TorqueException
2274    {
2275        setDbName(criteria);
2276
2277        addSelectColumns(criteria);
2278        int offset2 = numColumns + 1;
2279                                    
2280                    IssuePeer.addSelectColumns(criteria);
2281        int offset3 = offset2 + IssuePeer.numColumns;
2282                                                                
2283                    AttributePeer.addSelectColumns(criteria);
2284        int offset4 = offset3 + AttributePeer.numColumns;
2285                                                                
2286                    ActivitySetPeer.addSelectColumns(criteria);
2287        int offset5 = offset4 + ActivitySetPeer.numColumns;
2288                                                                
2289                                                  
2290                                                  
2291                    AttributeOptionPeer.addSelectColumns(criteria);
2292        int offset6 = offset5 + AttributeOptionPeer.numColumns;
2293                                                                
2294                    AttributeOptionPeer.addSelectColumns(criteria);
2295        int offset7 = offset6 + AttributeOptionPeer.numColumns;
2296                                                                
2297                    AttachmentPeer.addSelectColumns(criteria);
2298        int offset8 = offset7 + AttachmentPeer.numColumns;
2299                                                                
2300                    DependPeer.addSelectColumns(criteria);
2301        int offset9 = offset8 + DependPeer.numColumns;
2302                                                                                                                                                                                                                                                                                                                                                    
2303        List JavaDoc rows = BasePeer.doSelect(criteria);
2304        List JavaDoc results = new ArrayList JavaDoc();
2305
2306        for (int i = 0; i < rows.size(); i++)
2307        {
2308            Record row = (Record)rows.get(i);
2309
2310                            Class JavaDoc omClass = ActivityPeer.getOMClass();
2311                    Activity obj1 = (Activity)ActivityPeer
2312                .row2Object(row, 1, omClass);
2313                                                
2314                                                        
2315                            
2316              
2317                           omClass = IssuePeer.getOMClass();
2318                          Issue obj2 = (Issue)IssuePeer
2319                .row2Object( row, offset2, omClass);
2320
2321               boolean newObject = true;
2322            for (int j = 0; j < results.size(); j++)
2323            {
2324                Activity temp_obj1 = (Activity)results.get(j);
2325                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
2326                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2327                {
2328                    newObject = false;
2329                                    temp_obj2.addActivity(obj1);
2330                                    break;
2331                }
2332            }
2333                            if (newObject)
2334            {
2335                obj2.initActivitys();
2336                obj2.addActivity(obj1);
2337            }
2338                                                                                    
2339                                                        
2340                            
2341              
2342                           omClass = AttributePeer.getOMClass();
2343                          Attribute obj3 = (Attribute)AttributePeer
2344                .row2Object( row, offset3, omClass);
2345
2346               newObject = true;
2347            for (int j = 0; j < results.size(); j++)
2348            {
2349                Activity temp_obj1 = (Activity)results.get(j);
2350                Attribute temp_obj3 = (Attribute)temp_obj1.getAttribute();
2351                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2352                {
2353                    newObject = false;
2354                                    temp_obj3.addActivity(obj1);
2355                                    break;
2356                }
2357            }
2358                            if (newObject)
2359            {
2360                obj3.initActivitys();
2361                obj3.addActivity(obj1);
2362            }
2363                                                                                    
2364                                                        
2365                            
2366              
2367                           omClass = ActivitySetPeer.getOMClass();
2368                          ActivitySet obj4 = (ActivitySet)ActivitySetPeer
2369                .row2Object( row, offset4, omClass);
2370
2371               newObject = true;
2372            for (int j = 0; j < results.size(); j++)
2373            {
2374                Activity temp_obj1 = (Activity)results.get(j);
2375                ActivitySet temp_obj4 = (ActivitySet)temp_obj1.getActivitySet();
2376                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2377                {
2378                    newObject = false;
2379                                    temp_obj4.addActivity(obj1);
2380                                    break;
2381                }
2382            }
2383                            if (newObject)
2384            {
2385                obj4.initActivitys();
2386                obj4.addActivity(obj1);
2387            }
2388                                                                                                
2389                                                                              
2390                                                                  
2391                                                                        
2392                            
2393              
2394                           omClass = AttributeOptionPeer.getOMClass();
2395                          AttributeOption obj5 = (AttributeOption)AttributeOptionPeer
2396                .row2Object( row, offset5, omClass);
2397
2398               newObject = true;
2399            for (int j = 0; j < results.size(); j++)
2400            {
2401                Activity temp_obj1 = (Activity)results.get(j);
2402                AttributeOption temp_obj5 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
2403                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2404                {
2405                    newObject = false;
2406                                    temp_obj5.addActivityRelatedByOldOptionId(obj1);
2407                                    break;
2408                }
2409            }
2410                            if (newObject)
2411            {
2412                obj5.initActivitysRelatedByOldOptionId();
2413                obj5.addActivityRelatedByOldOptionId(obj1);
2414            }
2415                                                                                    
2416                                                                        
2417                            
2418              
2419                           omClass = AttributeOptionPeer.getOMClass();
2420                          AttributeOption obj6 = (AttributeOption)AttributeOptionPeer
2421                .row2Object( row, offset6, omClass);
2422
2423               newObject = true;
2424            for (int j = 0; j < results.size(); j++)
2425            {
2426                Activity temp_obj1 = (Activity)results.get(j);
2427                AttributeOption temp_obj6 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
2428                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2429                {
2430                    newObject = false;
2431                                    temp_obj6.addActivityRelatedByNewOptionId(obj1);
2432                                    break;
2433                }
2434            }
2435                            if (newObject)
2436            {
2437                obj6.initActivitysRelatedByNewOptionId();
2438                obj6.addActivityRelatedByNewOptionId(obj1);
2439            }
2440                                                                                    
2441                                                        
2442                            
2443              
2444                           omClass = AttachmentPeer.getOMClass();
2445                          Attachment obj7 = (Attachment)AttachmentPeer
2446                .row2Object( row, offset7, omClass);
2447
2448               newObject = true;
2449            for (int j = 0; j < results.size(); j++)
2450            {
2451                Activity temp_obj1 = (Activity)results.get(j);
2452                Attachment temp_obj7 = (Attachment)temp_obj1.getAttachment();
2453                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
2454                {
2455                    newObject = false;
2456                                    temp_obj7.addActivity(obj1);
2457                                    break;
2458                }
2459            }
2460                            if (newObject)
2461            {
2462                obj7.initActivitys();
2463                obj7.addActivity(obj1);
2464            }
2465                                                                                    
2466                                                        
2467                            
2468              
2469                           omClass = DependPeer.getOMClass();
2470                          Depend obj8 = (Depend)DependPeer
2471                .row2Object( row, offset8, omClass);
2472
2473               newObject = true;
2474            for (int j = 0; j < results.size(); j++)
2475            {
2476                Activity temp_obj1 = (Activity)results.get(j);
2477                Depend temp_obj8 = (Depend)temp_obj1.getDepend();
2478                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
2479                {
2480                    newObject = false;
2481                                    temp_obj8.addActivity(obj1);
2482                                    break;
2483                }
2484            }
2485                            if (newObject)
2486            {
2487                obj8.initActivitys();
2488                obj8.addActivity(obj1);
2489            }
2490                                                                results.add(obj1);
2491        }
2492        return results;
2493    }
2494        
2495        
2496                                            
2497                
2498
2499    /**
2500     * selects a collection of Activity objects pre-filled with
2501     * all related objects.
2502     *
2503     * This method is protected by default in order to keep the public
2504     * api reasonable. You can provide public methods for those you
2505     * actually need in ActivityPeer.
2506     *
2507     * @throws TorqueException Any exceptions caught during processing will be
2508     * rethrown wrapped into a TorqueException.
2509     */

2510    protected static List JavaDoc doSelectJoinAllExceptScarabUserImplRelatedByNewUserId(Criteria criteria)
2511        throws TorqueException
2512    {
2513        setDbName(criteria);
2514
2515        addSelectColumns(criteria);
2516        int offset2 = numColumns + 1;
2517                                    
2518                    IssuePeer.addSelectColumns(criteria);
2519        int offset3 = offset2 + IssuePeer.numColumns;
2520                                                                
2521                    AttributePeer.addSelectColumns(criteria);
2522        int offset4 = offset3 + AttributePeer.numColumns;
2523                                                                
2524                    ActivitySetPeer.addSelectColumns(criteria);
2525        int offset5 = offset4 + ActivitySetPeer.numColumns;
2526                                                                
2527                                                  
2528                                                  
2529                    AttributeOptionPeer.addSelectColumns(criteria);
2530        int offset6 = offset5 + AttributeOptionPeer.numColumns;
2531                                                                
2532                    AttributeOptionPeer.addSelectColumns(criteria);
2533        int offset7 = offset6 + AttributeOptionPeer.numColumns;
2534                                                                
2535                    AttachmentPeer.addSelectColumns(criteria);
2536        int offset8 = offset7 + AttachmentPeer.numColumns;
2537                                                                
2538                    DependPeer.addSelectColumns(criteria);
2539        int offset9 = offset8 + DependPeer.numColumns;
2540                                                                                                                                                                                                                                                                                                                                                    
2541        List JavaDoc rows = BasePeer.doSelect(criteria);
2542        List JavaDoc results = new ArrayList JavaDoc();
2543
2544        for (int i = 0; i < rows.size(); i++)
2545        {
2546            Record row = (Record)rows.get(i);
2547
2548                            Class JavaDoc omClass = ActivityPeer.getOMClass();
2549                    Activity obj1 = (Activity)ActivityPeer
2550                .row2Object(row, 1, omClass);
2551                                                
2552                                                        
2553                            
2554              
2555                           omClass = IssuePeer.getOMClass();
2556                          Issue obj2 = (Issue)IssuePeer
2557                .row2Object( row, offset2, omClass);
2558
2559               boolean newObject = true;
2560            for (int j = 0; j < results.size(); j++)
2561            {
2562                Activity temp_obj1 = (Activity)results.get(j);
2563                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
2564                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2565                {
2566                    newObject = false;
2567                                    temp_obj2.addActivity(obj1);
2568                                    break;
2569                }
2570            }
2571                            if (newObject)
2572            {
2573                obj2.initActivitys();
2574                obj2.addActivity(obj1);
2575            }
2576                                                                                    
2577                                                        
2578                            
2579              
2580                           omClass = AttributePeer.getOMClass();
2581                          Attribute obj3 = (Attribute)AttributePeer
2582                .row2Object( row, offset3, omClass);
2583
2584               newObject = true;
2585            for (int j = 0; j < results.size(); j++)
2586            {
2587                Activity temp_obj1 = (Activity)results.get(j);
2588                Attribute temp_obj3 = (Attribute)temp_obj1.getAttribute();
2589                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2590                {
2591                    newObject = false;
2592                                    temp_obj3.addActivity(obj1);
2593                                    break;
2594                }
2595            }
2596                            if (newObject)
2597            {
2598                obj3.initActivitys();
2599                obj3.addActivity(obj1);
2600            }
2601                                                                                    
2602                                                        
2603                            
2604              
2605                           omClass = ActivitySetPeer.getOMClass();
2606                          ActivitySet obj4 = (ActivitySet)ActivitySetPeer
2607                .row2Object( row, offset4, omClass);
2608
2609               newObject = true;
2610            for (int j = 0; j < results.size(); j++)
2611            {
2612                Activity temp_obj1 = (Activity)results.get(j);
2613                ActivitySet temp_obj4 = (ActivitySet)temp_obj1.getActivitySet();
2614                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2615                {
2616                    newObject = false;
2617                                    temp_obj4.addActivity(obj1);
2618                                    break;
2619                }
2620            }
2621                            if (newObject)
2622            {
2623                obj4.initActivitys();
2624                obj4.addActivity(obj1);
2625            }
2626                                                                                                
2627                                                                              
2628                                                                  
2629                                                                        
2630                            
2631              
2632                           omClass = AttributeOptionPeer.getOMClass();
2633                          AttributeOption obj5 = (AttributeOption)AttributeOptionPeer
2634                .row2Object( row, offset5, omClass);
2635
2636               newObject = true;
2637            for (int j = 0; j < results.size(); j++)
2638            {
2639                Activity temp_obj1 = (Activity)results.get(j);
2640                AttributeOption temp_obj5 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
2641                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2642                {
2643                    newObject = false;
2644                                    temp_obj5.addActivityRelatedByOldOptionId(obj1);
2645                                    break;
2646                }
2647            }
2648                            if (newObject)
2649            {
2650                obj5.initActivitysRelatedByOldOptionId();
2651                obj5.addActivityRelatedByOldOptionId(obj1);
2652            }
2653                                                                                    
2654                                                                        
2655                            
2656              
2657                           omClass = AttributeOptionPeer.getOMClass();
2658                          AttributeOption obj6 = (AttributeOption)AttributeOptionPeer
2659                .row2Object( row, offset6, omClass);
2660
2661               newObject = true;
2662            for (int j = 0; j < results.size(); j++)
2663            {
2664                Activity temp_obj1 = (Activity)results.get(j);
2665                AttributeOption temp_obj6 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
2666                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2667                {
2668                    newObject = false;
2669                                    temp_obj6.addActivityRelatedByNewOptionId(obj1);
2670                                    break;
2671                }
2672            }
2673                            if (newObject)
2674            {
2675                obj6.initActivitysRelatedByNewOptionId();
2676                obj6.addActivityRelatedByNewOptionId(obj1);
2677            }
2678                                                                                    
2679                                                        
2680                            
2681              
2682                           omClass = AttachmentPeer.getOMClass();
2683                          Attachment obj7 = (Attachment)AttachmentPeer
2684                .row2Object( row, offset7, omClass);
2685
2686               newObject = true;
2687            for (int j = 0; j < results.size(); j++)
2688            {
2689                Activity temp_obj1 = (Activity)results.get(j);
2690                Attachment temp_obj7 = (Attachment)temp_obj1.getAttachment();
2691                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
2692                {
2693                    newObject = false;
2694                                    temp_obj7.addActivity(obj1);
2695                                    break;
2696                }
2697            }
2698                            if (newObject)
2699            {
2700                obj7.initActivitys();
2701                obj7.addActivity(obj1);
2702            }
2703                                                                                    
2704                                                        
2705                            
2706              
2707                           omClass = DependPeer.getOMClass();
2708                          Depend obj8 = (Depend)DependPeer
2709                .row2Object( row, offset8, omClass);
2710
2711               newObject = true;
2712            for (int j = 0; j < results.size(); j++)
2713            {
2714                Activity temp_obj1 = (Activity)results.get(j);
2715                Depend temp_obj8 = (Depend)temp_obj1.getDepend();
2716                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
2717                {
2718                    newObject = false;
2719                                    temp_obj8.addActivity(obj1);
2720                                    break;
2721                }
2722            }
2723                            if (newObject)
2724            {
2725                obj8.initActivitys();
2726                obj8.addActivity(obj1);
2727            }
2728                                                                results.add(obj1);
2729        }
2730        return results;
2731    }
2732        
2733        
2734                                            
2735                
2736
2737    /**
2738     * selects a collection of Activity objects pre-filled with
2739     * all related objects.
2740     *
2741     * This method is protected by default in order to keep the public
2742     * api reasonable. You can provide public methods for those you
2743     * actually need in ActivityPeer.
2744     *
2745     * @throws TorqueException Any exceptions caught during processing will be
2746     * rethrown wrapped into a TorqueException.
2747     */

2748    protected static List JavaDoc doSelectJoinAllExceptAttributeOptionRelatedByOldOptionId(Criteria criteria)
2749        throws TorqueException
2750    {
2751        setDbName(criteria);
2752
2753        addSelectColumns(criteria);
2754        int offset2 = numColumns + 1;
2755                                    
2756                    IssuePeer.addSelectColumns(criteria);
2757        int offset3 = offset2 + IssuePeer.numColumns;
2758                                                                
2759                    AttributePeer.addSelectColumns(criteria);
2760        int offset4 = offset3 + AttributePeer.numColumns;
2761                                                                
2762                    ActivitySetPeer.addSelectColumns(criteria);
2763        int offset5 = offset4 + ActivitySetPeer.numColumns;
2764                                                                
2765                    ScarabUserImplPeer.addSelectColumns(criteria);
2766        int offset6 = offset5 + ScarabUserImplPeer.numColumns;
2767                                                                
2768                    ScarabUserImplPeer.addSelectColumns(criteria);
2769        int offset7 = offset6 + ScarabUserImplPeer.numColumns;
2770                                                                
2771                                                  
2772                                                  
2773                    AttachmentPeer.addSelectColumns(criteria);
2774        int offset8 = offset7 + AttachmentPeer.numColumns;
2775                                                                
2776                    DependPeer.addSelectColumns(criteria);
2777        int offset9 = offset8 + DependPeer.numColumns;
2778                                                                                                                                                                                                                                                                                                                                                    
2779        List JavaDoc rows = BasePeer.doSelect(criteria);
2780        List JavaDoc results = new ArrayList JavaDoc();
2781
2782        for (int i = 0; i < rows.size(); i++)
2783        {
2784            Record row = (Record)rows.get(i);
2785
2786                            Class JavaDoc omClass = ActivityPeer.getOMClass();
2787                    Activity obj1 = (Activity)ActivityPeer
2788                .row2Object(row, 1, omClass);
2789                                                
2790                                                        
2791                            
2792              
2793                           omClass = IssuePeer.getOMClass();
2794                          Issue obj2 = (Issue)IssuePeer
2795                .row2Object( row, offset2, omClass);
2796
2797               boolean newObject = true;
2798            for (int j = 0; j < results.size(); j++)
2799            {
2800                Activity temp_obj1 = (Activity)results.get(j);
2801                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
2802                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2803                {
2804                    newObject = false;
2805                                    temp_obj2.addActivity(obj1);
2806                                    break;
2807                }
2808            }
2809                            if (newObject)
2810            {
2811                obj2.initActivitys();
2812                obj2.addActivity(obj1);
2813            }
2814                                                                                    
2815                                                        
2816                            
2817              
2818                           omClass = AttributePeer.getOMClass();
2819                          Attribute obj3 = (Attribute)AttributePeer
2820                .row2Object( row, offset3, omClass);
2821
2822               newObject = true;
2823            for (int j = 0; j < results.size(); j++)
2824            {
2825                Activity temp_obj1 = (Activity)results.get(j);
2826                Attribute temp_obj3 = (Attribute)temp_obj1.getAttribute();
2827                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2828                {
2829                    newObject = false;
2830                                    temp_obj3.addActivity(obj1);
2831                                    break;
2832                }
2833            }
2834                            if (newObject)
2835            {
2836                obj3.initActivitys();
2837                obj3.addActivity(obj1);
2838            }
2839                                                                                    
2840                                                        
2841                            
2842              
2843                           omClass = ActivitySetPeer.getOMClass();
2844                          ActivitySet obj4 = (ActivitySet)ActivitySetPeer
2845                .row2Object( row, offset4, omClass);
2846
2847               newObject = true;
2848            for (int j = 0; j < results.size(); j++)
2849            {
2850                Activity temp_obj1 = (Activity)results.get(j);
2851                ActivitySet temp_obj4 = (ActivitySet)temp_obj1.getActivitySet();
2852                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2853                {
2854                    newObject = false;
2855                                    temp_obj4.addActivity(obj1);
2856                                    break;
2857                }
2858            }
2859                            if (newObject)
2860            {
2861                obj4.initActivitys();
2862                obj4.addActivity(obj1);
2863            }
2864                                                                                                
2865                                                                        
2866                            
2867              
2868                           omClass = ScarabUserImplPeer.getOMClass();
2869                          ScarabUserImpl obj5 = (ScarabUserImpl)ScarabUserImplPeer
2870                .row2Object( row, offset5, omClass);
2871
2872               newObject = true;
2873            for (int j = 0; j < results.size(); j++)
2874            {
2875                Activity temp_obj1 = (Activity)results.get(j);
2876                ScarabUserImpl temp_obj5 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOldUserId();
2877                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2878                {
2879                    newObject = false;
2880                                    temp_obj5.addActivityRelatedByOldUserId(obj1);
2881                                    break;
2882                }
2883            }
2884                            if (newObject)
2885            {
2886                obj5.initActivitysRelatedByOldUserId();
2887                obj5.addActivityRelatedByOldUserId(obj1);
2888            }
2889                                                                                                
2890                                                                        
2891                            
2892              
2893                           omClass = ScarabUserImplPeer.getOMClass();
2894                          ScarabUserImpl obj6 = (ScarabUserImpl)ScarabUserImplPeer
2895                .row2Object( row, offset6, omClass);
2896
2897               newObject = true;
2898            for (int j = 0; j < results.size(); j++)
2899            {
2900                Activity temp_obj1 = (Activity)results.get(j);
2901                ScarabUserImpl temp_obj6 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
2902                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2903                {
2904                    newObject = false;
2905                                    temp_obj6.addActivityRelatedByNewUserId(obj1);
2906                                    break;
2907                }
2908            }
2909                            if (newObject)
2910            {
2911                obj6.initActivitysRelatedByNewUserId();
2912                obj6.addActivityRelatedByNewUserId(obj1);
2913            }
2914                                                                                    
2915                                                                  
2916                                                                  
2917                                                        
2918                            
2919              
2920                           omClass = AttachmentPeer.getOMClass();
2921                          Attachment obj7 = (Attachment)AttachmentPeer
2922                .row2Object( row, offset7, omClass);
2923
2924               newObject = true;
2925            for (int j = 0; j < results.size(); j++)
2926            {
2927                Activity temp_obj1 = (Activity)results.get(j);
2928                Attachment temp_obj7 = (Attachment)temp_obj1.getAttachment();
2929                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
2930                {
2931                    newObject = false;
2932                                    temp_obj7.addActivity(obj1);
2933                                    break;
2934                }
2935            }
2936                            if (newObject)
2937            {
2938                obj7.initActivitys();
2939                obj7.addActivity(obj1);
2940            }
2941                                                                                    
2942                                                        
2943                            
2944              
2945                           omClass = DependPeer.getOMClass();
2946                          Depend obj8 = (Depend)DependPeer
2947                .row2Object( row, offset8, omClass);
2948
2949               newObject = true;
2950            for (int j = 0; j < results.size(); j++)
2951            {
2952                Activity temp_obj1 = (Activity)results.get(j);
2953                Depend temp_obj8 = (Depend)temp_obj1.getDepend();
2954                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
2955                {
2956                    newObject = false;
2957                                    temp_obj8.addActivity(obj1);
2958                                    break;
2959                }
2960            }
2961                            if (newObject)
2962            {
2963                obj8.initActivitys();
2964                obj8.addActivity(obj1);
2965            }
2966                                                                results.add(obj1);
2967        }
2968        return results;
2969    }
2970        
2971        
2972                                            
2973                
2974
2975    /**
2976     * selects a collection of Activity objects pre-filled with
2977     * all related objects.
2978     *
2979     * This method is protected by default in order to keep the public
2980     * api reasonable. You can provide public methods for those you
2981     * actually need in ActivityPeer.
2982     *
2983     * @throws TorqueException Any exceptions caught during processing will be
2984     * rethrown wrapped into a TorqueException.
2985     */

2986    protected static List JavaDoc doSelectJoinAllExceptAttributeOptionRelatedByNewOptionId(Criteria criteria)
2987        throws TorqueException
2988    {
2989        setDbName(criteria);
2990
2991        addSelectColumns(criteria);
2992        int offset2 = numColumns + 1;
2993                                    
2994                    IssuePeer.addSelectColumns(criteria);
2995        int offset3 = offset2 + IssuePeer.numColumns;
2996                                                                
2997                    AttributePeer.addSelectColumns(criteria);
2998        int offset4 = offset3 + AttributePeer.numColumns;
2999                                                                
3000                    ActivitySetPeer.addSelectColumns(criteria);
3001        int offset5 = offset4 + ActivitySetPeer.numColumns;
3002                                                                
3003                    ScarabUserImplPeer.addSelectColumns(criteria);
3004        int offset6 = offset5 + ScarabUserImplPeer.numColumns;
3005                                                                
3006                    ScarabUserImplPeer.addSelectColumns(criteria);
3007        int offset7 = offset6 + ScarabUserImplPeer.numColumns;
3008                                                                
3009                                                  
3010                                                  
3011                    AttachmentPeer.addSelectColumns(criteria);
3012        int offset8 = offset7 + AttachmentPeer.numColumns;
3013                                                                
3014                    DependPeer.addSelectColumns(criteria);
3015        int offset9 = offset8 + DependPeer.numColumns;
3016                                                                                                                                                                                                                                                                                                                                                    
3017        List JavaDoc rows = BasePeer.doSelect(criteria);
3018        List JavaDoc results = new ArrayList JavaDoc();
3019
3020        for (int i = 0; i < rows.size(); i++)
3021        {
3022            Record row = (Record)rows.get(i);
3023
3024                            Class JavaDoc omClass = ActivityPeer.getOMClass();
3025                    Activity obj1 = (Activity)ActivityPeer
3026                .row2Object(row, 1, omClass);
3027                                                
3028                                                        
3029                            
3030              
3031                           omClass = IssuePeer.getOMClass();
3032                          Issue obj2 = (Issue)IssuePeer
3033                .row2Object( row, offset2, omClass);
3034
3035               boolean newObject = true;
3036            for (int j = 0; j < results.size(); j++)
3037            {
3038                Activity temp_obj1 = (Activity)results.get(j);
3039                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
3040                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
3041                {
3042                    newObject = false;
3043                                    temp_obj2.addActivity(obj1);
3044                                    break;
3045                }
3046            }
3047                            if (newObject)
3048            {
3049                obj2.initActivitys();
3050                obj2.addActivity(obj1);
3051            }
3052                                                                                    
3053                                                        
3054                            
3055              
3056                           omClass = AttributePeer.getOMClass();
3057                          Attribute obj3 = (Attribute)AttributePeer
3058                .row2Object( row, offset3, omClass);
3059
3060               newObject = true;
3061            for (int j = 0; j < results.size(); j++)
3062            {
3063                Activity temp_obj1 = (Activity)results.get(j);
3064                Attribute temp_obj3 = (Attribute)temp_obj1.getAttribute();
3065                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
3066                {
3067                    newObject = false;
3068                                    temp_obj3.addActivity(obj1);
3069                                    break;
3070                }
3071            }
3072                            if (newObject)
3073            {
3074                obj3.initActivitys();
3075                obj3.addActivity(obj1);
3076            }
3077                                                                                    
3078                                                        
3079                            
3080              
3081                           omClass = ActivitySetPeer.getOMClass();
3082                          ActivitySet obj4 = (ActivitySet)ActivitySetPeer
3083                .row2Object( row, offset4, omClass);
3084
3085               newObject = true;
3086            for (int j = 0; j < results.size(); j++)
3087            {
3088                Activity temp_obj1 = (Activity)results.get(j);
3089                ActivitySet temp_obj4 = (ActivitySet)temp_obj1.getActivitySet();
3090                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
3091                {
3092                    newObject = false;
3093                                    temp_obj4.addActivity(obj1);
3094                                    break;
3095                }
3096            }
3097                            if (newObject)
3098            {
3099                obj4.initActivitys();
3100                obj4.addActivity(obj1);
3101            }
3102                                                                                                
3103                                                                        
3104                            
3105              
3106                           omClass = ScarabUserImplPeer.getOMClass();
3107                          ScarabUserImpl obj5 = (ScarabUserImpl)ScarabUserImplPeer
3108                .row2Object( row, offset5, omClass);
3109
3110               newObject = true;
3111            for (int j = 0; j < results.size(); j++)
3112            {
3113                Activity temp_obj1 = (Activity)results.get(j);
3114                ScarabUserImpl temp_obj5 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOldUserId();
3115                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
3116                {
3117                    newObject = false;
3118                                    temp_obj5.addActivityRelatedByOldUserId(obj1);
3119                                    break;
3120                }
3121            }
3122                            if (newObject)
3123            {
3124                obj5.initActivitysRelatedByOldUserId();
3125                obj5.addActivityRelatedByOldUserId(obj1);
3126            }
3127                                                                                                
3128                                                                        
3129                            
3130              
3131                           omClass = ScarabUserImplPeer.getOMClass();
3132                          ScarabUserImpl obj6 = (ScarabUserImpl)ScarabUserImplPeer
3133                .row2Object( row, offset6, omClass);
3134
3135               newObject = true;
3136            for (int j = 0; j < results.size(); j++)
3137            {
3138                Activity temp_obj1 = (Activity)results.get(j);
3139                ScarabUserImpl temp_obj6 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
3140                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
3141                {
3142                    newObject = false;
3143                                    temp_obj6.addActivityRelatedByNewUserId(obj1);
3144                                    break;
3145                }
3146            }
3147                            if (newObject)
3148            {
3149                obj6.initActivitysRelatedByNewUserId();
3150                obj6.addActivityRelatedByNewUserId(obj1);
3151            }
3152                                                                                    
3153                                                                  
3154                                                                  
3155                                                        
3156                            
3157              
3158                           omClass = AttachmentPeer.getOMClass();
3159                          Attachment obj7 = (Attachment)AttachmentPeer
3160                .row2Object( row, offset7, omClass);
3161
3162               newObject = true;
3163            for (int j = 0; j < results.size(); j++)
3164            {
3165                Activity temp_obj1 = (Activity)results.get(j);
3166                Attachment temp_obj7 = (Attachment)temp_obj1.getAttachment();
3167                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
3168                {
3169                    newObject = false;
3170                                    temp_obj7.addActivity(obj1);
3171                                    break;
3172                }
3173            }
3174                            if (newObject)
3175            {
3176                obj7.initActivitys();
3177                obj7.addActivity(obj1);
3178            }
3179                                                                                    
3180                                                        
3181                            
3182              
3183                           omClass = DependPeer.getOMClass();
3184                          Depend obj8 = (Depend)DependPeer
3185                .row2Object( row, offset8, omClass);
3186
3187               newObject = true;
3188            for (int j = 0; j < results.size(); j++)
3189            {
3190                Activity temp_obj1 = (Activity)results.get(j);
3191                Depend temp_obj8 = (Depend)temp_obj1.getDepend();
3192                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
3193                {
3194                    newObject = false;
3195                                    temp_obj8.addActivity(obj1);
3196                                    break;
3197                }
3198            }
3199                            if (newObject)
3200            {
3201                obj8.initActivitys();
3202                obj8.addActivity(obj1);
3203            }
3204                                                                results.add(obj1);
3205        }
3206        return results;
3207    }
3208        
3209        
3210                                  
3211                
3212
3213    /**
3214     * selects a collection of Activity objects pre-filled with
3215     * all related objects.
3216     *
3217     * This method is protected by default in order to keep the public
3218     * api reasonable. You can provide public methods for those you
3219     * actually need in ActivityPeer.
3220     *
3221     * @throws TorqueException Any exceptions caught during processing will be
3222     * rethrown wrapped into a TorqueException.
3223     */

3224    protected static List JavaDoc doSelectJoinAllExceptAttachment(Criteria criteria)
3225        throws TorqueException
3226    {
3227        setDbName(criteria);
3228
3229        addSelectColumns(criteria);
3230        int offset2 = numColumns + 1;
3231                                    
3232                    IssuePeer.addSelectColumns(criteria);
3233        int offset3 = offset2 + IssuePeer.numColumns;
3234                                                                
3235                    AttributePeer.addSelectColumns(criteria);
3236        int offset4 = offset3 + AttributePeer.numColumns;
3237                                                                
3238                    ActivitySetPeer.addSelectColumns(criteria);
3239        int offset5 = offset4 + ActivitySetPeer.numColumns;
3240                                                                
3241                    ScarabUserImplPeer.addSelectColumns(criteria);
3242        int offset6 = offset5 + ScarabUserImplPeer.numColumns;
3243                                                                
3244                    ScarabUserImplPeer.addSelectColumns(criteria);
3245        int offset7 = offset6 + ScarabUserImplPeer.numColumns;
3246                                                                
3247                    AttributeOptionPeer.addSelectColumns(criteria);
3248        int offset8 = offset7 + AttributeOptionPeer.numColumns;
3249                                                                
3250                    AttributeOptionPeer.addSelectColumns(criteria);
3251        int offset9 = offset8 + AttributeOptionPeer.numColumns;
3252                                                                
3253                                                  
3254                    DependPeer.addSelectColumns(criteria);
3255        int offset10 = offset9 + DependPeer.numColumns;
3256                                                                                                                                                                                                                                                                                                                                                    
3257        List JavaDoc rows = BasePeer.doSelect(criteria);
3258        List JavaDoc results = new ArrayList JavaDoc();
3259
3260        for (int i = 0; i < rows.size(); i++)
3261        {
3262            Record row = (Record)rows.get(i);
3263
3264                            Class JavaDoc omClass = ActivityPeer.getOMClass();
3265                    Activity obj1 = (Activity)ActivityPeer
3266                .row2Object(row, 1, omClass);
3267                                                
3268                                                        
3269                            
3270              
3271                           omClass = IssuePeer.getOMClass();
3272                          Issue obj2 = (Issue)IssuePeer
3273                .row2Object( row, offset2, omClass);
3274
3275               boolean newObject = true;
3276            for (int j = 0; j < results.size(); j++)
3277            {
3278                Activity temp_obj1 = (Activity)results.get(j);
3279                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
3280                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
3281                {
3282                    newObject = false;
3283                                    temp_obj2.addActivity(obj1);
3284                                    break;
3285                }
3286            }
3287                            if (newObject)
3288            {
3289                obj2.initActivitys();
3290                obj2.addActivity(obj1);
3291            }
3292                                                                                    
3293                                                        
3294                            
3295              
3296                           omClass = AttributePeer.getOMClass();
3297                          Attribute obj3 = (Attribute)AttributePeer
3298                .row2Object( row, offset3, omClass);
3299
3300               newObject = true;
3301            for (int j = 0; j < results.size(); j++)
3302            {
3303                Activity temp_obj1 = (Activity)results.get(j);
3304                Attribute temp_obj3 = (Attribute)temp_obj1.getAttribute();
3305                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
3306                {
3307                    newObject = false;
3308                                    temp_obj3.addActivity(obj1);
3309                                    break;
3310                }
3311            }
3312                            if (newObject)
3313            {
3314                obj3.initActivitys();
3315                obj3.addActivity(obj1);
3316            }
3317                                                                                    
3318                                                        
3319                            
3320              
3321                           omClass = ActivitySetPeer.getOMClass();
3322                          ActivitySet obj4 = (ActivitySet)ActivitySetPeer
3323                .row2Object( row, offset4, omClass);
3324
3325               newObject = true;
3326            for (int j = 0; j < results.size(); j++)
3327            {
3328                Activity temp_obj1 = (Activity)results.get(j);
3329                ActivitySet temp_obj4 = (ActivitySet)temp_obj1.getActivitySet();
3330                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
3331                {
3332                    newObject = false;
3333                                    temp_obj4.addActivity(obj1);
3334                                    break;
3335                }
3336            }
3337                            if (newObject)
3338            {
3339                obj4.initActivitys();
3340                obj4.addActivity(obj1);
3341            }
3342                                                                                                
3343                                                                        
3344                            
3345              
3346                           omClass = ScarabUserImplPeer.getOMClass();
3347                          ScarabUserImpl obj5 = (ScarabUserImpl)ScarabUserImplPeer
3348                .row2Object( row, offset5, omClass);
3349
3350               newObject = true;
3351            for (int j = 0; j < results.size(); j++)
3352            {
3353                Activity temp_obj1 = (Activity)results.get(j);
3354                ScarabUserImpl temp_obj5 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOldUserId();
3355                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
3356                {
3357                    newObject = false;
3358                                    temp_obj5.addActivityRelatedByOldUserId(obj1);
3359                                    break;
3360                }
3361            }
3362                            if (newObject)
3363            {
3364                obj5.initActivitysRelatedByOldUserId();
3365                obj5.addActivityRelatedByOldUserId(obj1);
3366            }
3367                                                                                                
3368                                                                        
3369                            
3370              
3371                           omClass = ScarabUserImplPeer.getOMClass();
3372                          ScarabUserImpl obj6 = (ScarabUserImpl)ScarabUserImplPeer
3373                .row2Object( row, offset6, omClass);
3374
3375               newObject = true;
3376            for (int j = 0; j < results.size(); j++)
3377            {
3378                Activity temp_obj1 = (Activity)results.get(j);
3379                ScarabUserImpl temp_obj6 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
3380                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
3381                {
3382                    newObject = false;
3383                                    temp_obj6.addActivityRelatedByNewUserId(obj1);
3384                                    break;
3385                }
3386            }
3387                            if (newObject)
3388            {
3389                obj6.initActivitysRelatedByNewUserId();
3390                obj6.addActivityRelatedByNewUserId(obj1);
3391            }
3392                                                                                    
3393                                                                        
3394                            
3395              
3396                           omClass = AttributeOptionPeer.getOMClass();
3397                          AttributeOption obj7 = (AttributeOption)AttributeOptionPeer
3398                .row2Object( row, offset7, omClass);
3399
3400               newObject = true;
3401            for (int j = 0; j < results.size(); j++)
3402            {
3403                Activity temp_obj1 = (Activity)results.get(j);
3404                AttributeOption temp_obj7 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
3405                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
3406                {
3407                    newObject = false;
3408                                    temp_obj7.addActivityRelatedByOldOptionId(obj1);
3409                                    break;
3410                }
3411            }
3412                            if (newObject)
3413            {
3414                obj7.initActivitysRelatedByOldOptionId();
3415                obj7.addActivityRelatedByOldOptionId(obj1);
3416            }
3417                                                                                    
3418                                                                        
3419                            
3420              
3421                           omClass = AttributeOptionPeer.getOMClass();
3422                          AttributeOption obj8 = (AttributeOption)AttributeOptionPeer
3423                .row2Object( row, offset8, omClass);
3424
3425               newObject = true;
3426            for (int j = 0; j < results.size(); j++)
3427            {
3428                Activity temp_obj1 = (Activity)results.get(j);
3429                AttributeOption temp_obj8 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
3430                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
3431                {
3432                    newObject = false;
3433                                    temp_obj8.addActivityRelatedByNewOptionId(obj1);
3434                                    break;
3435                }
3436            }
3437                            if (newObject)
3438            {
3439                obj8.initActivitysRelatedByNewOptionId();
3440                obj8.addActivityRelatedByNewOptionId(obj1);
3441            }
3442                                                                                    
3443                                                                  
3444                                                        
3445                            
3446              
3447                           omClass = DependPeer.getOMClass();
3448                          Depend obj9 = (Depend)DependPeer
3449                .row2Object( row, offset9, omClass);
3450
3451               newObject = true;
3452            for (int j = 0; j < results.size(); j++)
3453            {
3454                Activity temp_obj1 = (Activity)results.get(j);
3455                Depend temp_obj9 = (Depend)temp_obj1.getDepend();
3456                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
3457                {
3458                    newObject = false;
3459                                    temp_obj9.addActivity(obj1);
3460                                    break;
3461                }
3462            }
3463                            if (newObject)
3464            {
3465                obj9.initActivitys();
3466                obj9.addActivity(obj1);
3467            }
3468                                                                results.add(obj1);
3469        }
3470        return results;
3471    }
3472        
3473        
3474                                  
3475                
3476
3477    /**
3478     * selects a collection of Activity objects pre-filled with
3479     * all related objects.
3480     *
3481     * This method is protected by default in order to keep the public
3482     * api reasonable. You can provide public methods for those you
3483     * actually need in ActivityPeer.
3484     *
3485     * @throws TorqueException Any exceptions caught during processing will be
3486     * rethrown wrapped into a TorqueException.
3487     */

3488    protected static List JavaDoc doSelectJoinAllExceptDepend(Criteria criteria)
3489        throws TorqueException
3490    {
3491        setDbName(criteria);
3492
3493        addSelectColumns(criteria);
3494        int offset2 = numColumns + 1;
3495                                    
3496                    IssuePeer.addSelectColumns(criteria);
3497        int offset3 = offset2 + IssuePeer.numColumns;
3498                                                                
3499                    AttributePeer.addSelectColumns(criteria);
3500        int offset4 = offset3 + AttributePeer.numColumns;
3501                                                                
3502                    ActivitySetPeer.addSelectColumns(criteria);
3503        int offset5 = offset4 + ActivitySetPeer.numColumns;
3504                                                                
3505                    ScarabUserImplPeer.addSelectColumns(criteria);
3506        int offset6 = offset5 + ScarabUserImplPeer.numColumns;
3507                                                                
3508                    ScarabUserImplPeer.addSelectColumns(criteria);
3509        int offset7 = offset6 + ScarabUserImplPeer.numColumns;
3510                                                                
3511                    AttributeOptionPeer.addSelectColumns(criteria);
3512        int offset8 = offset7 + AttributeOptionPeer.numColumns;
3513                                                                
3514                    AttributeOptionPeer.addSelectColumns(criteria);
3515        int offset9 = offset8 + AttributeOptionPeer.numColumns;
3516                                                                
3517                    AttachmentPeer.addSelectColumns(criteria);
3518        int offset10 = offset9 + AttachmentPeer.numColumns;
3519                                                                
3520                                                                                                                                                                                                                                                                                                                                      
3521        List JavaDoc rows = BasePeer.doSelect(criteria);
3522        List JavaDoc results = new ArrayList JavaDoc();
3523
3524        for (int i = 0; i < rows.size(); i++)
3525        {
3526            Record row = (Record)rows.get(i);
3527
3528                            Class JavaDoc omClass = ActivityPeer.getOMClass();
3529                    Activity obj1 = (Activity)ActivityPeer
3530                .row2Object(row, 1, omClass);
3531                                                
3532                                                        
3533                            
3534              
3535                           omClass = IssuePeer.getOMClass();
3536                          Issue obj2 = (Issue)IssuePeer
3537                .row2Object( row, offset2, omClass);
3538
3539               boolean newObject = true;
3540            for (int j = 0; j < results.size(); j++)
3541            {
3542                Activity temp_obj1 = (Activity)results.get(j);
3543                Issue temp_obj2 = (Issue)temp_obj1.getIssue();
3544                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
3545                {
3546                    newObject = false;
3547                                    temp_obj2.addActivity(obj1);
3548                                    break;
3549                }
3550            }
3551                            if (newObject)
3552            {
3553                obj2.initActivitys();
3554                obj2.addActivity(obj1);
3555            }
3556                                                                                    
3557                                                        
3558                            
3559              
3560                           omClass = AttributePeer.getOMClass();
3561                          Attribute obj3 = (Attribute)AttributePeer
3562                .row2Object( row, offset3, omClass);
3563
3564               newObject = true;
3565            for (int j = 0; j < results.size(); j++)
3566            {
3567                Activity temp_obj1 = (Activity)results.get(j);
3568                Attribute temp_obj3 = (Attribute)temp_obj1.getAttribute();
3569                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
3570                {
3571                    newObject = false;
3572                                    temp_obj3.addActivity(obj1);
3573                                    break;
3574                }
3575            }
3576                            if (newObject)
3577            {
3578                obj3.initActivitys();
3579                obj3.addActivity(obj1);
3580            }
3581                                                                                    
3582                                                        
3583                            
3584              
3585                           omClass = ActivitySetPeer.getOMClass();
3586                          ActivitySet obj4 = (ActivitySet)ActivitySetPeer
3587                .row2Object( row, offset4, omClass);
3588
3589               newObject = true;
3590            for (int j = 0; j < results.size(); j++)
3591            {
3592                Activity temp_obj1 = (Activity)results.get(j);
3593                ActivitySet temp_obj4 = (ActivitySet)temp_obj1.getActivitySet();
3594                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
3595                {
3596                    newObject = false;
3597                                    temp_obj4.addActivity(obj1);
3598                                    break;
3599                }
3600            }
3601                            if (newObject)
3602            {
3603                obj4.initActivitys();
3604                obj4.addActivity(obj1);
3605            }
3606                                                                                                
3607                                                                        
3608                            
3609              
3610                           omClass = ScarabUserImplPeer.getOMClass();
3611                          ScarabUserImpl obj5 = (ScarabUserImpl)ScarabUserImplPeer
3612                .row2Object( row, offset5, omClass);
3613
3614               newObject = true;
3615            for (int j = 0; j < results.size(); j++)
3616            {
3617                Activity temp_obj1 = (Activity)results.get(j);
3618                ScarabUserImpl temp_obj5 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOldUserId();
3619                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
3620                {
3621                    newObject = false;
3622                                    temp_obj5.addActivityRelatedByOldUserId(obj1);
3623                                    break;
3624                }
3625            }
3626                            if (newObject)
3627            {
3628                obj5.initActivitysRelatedByOldUserId();
3629                obj5.addActivityRelatedByOldUserId(obj1);
3630            }
3631                                                                                                
3632                                                                        
3633                            
3634              
3635                           omClass = ScarabUserImplPeer.getOMClass();
3636                          ScarabUserImpl obj6 = (ScarabUserImpl)ScarabUserImplPeer
3637                .row2Object( row, offset6, omClass);
3638
3639               newObject = true;
3640            for (int j = 0; j < results.size(); j++)
3641            {
3642                Activity temp_obj1 = (Activity)results.get(j);
3643                ScarabUserImpl temp_obj6 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByNewUserId();
3644                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
3645                {
3646                    newObject = false;
3647                                    temp_obj6.addActivityRelatedByNewUserId(obj1);
3648                                    break;
3649                }
3650            }
3651                            if (newObject)
3652            {
3653                obj6.initActivitysRelatedByNewUserId();
3654                obj6.addActivityRelatedByNewUserId(obj1);
3655            }
3656                                                                                    
3657                                                                        
3658                            
3659              
3660                           omClass = AttributeOptionPeer.getOMClass();
3661                          AttributeOption obj7 = (AttributeOption)AttributeOptionPeer
3662                .row2Object( row, offset7, omClass);
3663
3664               newObject = true;
3665            for (int j = 0; j < results.size(); j++)
3666            {
3667                Activity temp_obj1 = (Activity)results.get(j);
3668                AttributeOption temp_obj7 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByOldOptionId();
3669                if (temp_obj7.getPrimaryKey().equals(obj7.getPrimaryKey()))
3670                {
3671                    newObject = false;
3672                                    temp_obj7.addActivityRelatedByOldOptionId(obj1);
3673                                    break;
3674                }
3675            }
3676                            if (newObject)
3677            {
3678                obj7.initActivitysRelatedByOldOptionId();
3679                obj7.addActivityRelatedByOldOptionId(obj1);
3680            }
3681                                                                                    
3682                                                                        
3683                            
3684              
3685                           omClass = AttributeOptionPeer.getOMClass();
3686                          AttributeOption obj8 = (AttributeOption)AttributeOptionPeer
3687                .row2Object( row, offset8, omClass);
3688
3689               newObject = true;
3690            for (int j = 0; j < results.size(); j++)
3691            {
3692                Activity temp_obj1 = (Activity)results.get(j);
3693                AttributeOption temp_obj8 = (AttributeOption)temp_obj1.getAttributeOptionRelatedByNewOptionId();
3694                if (temp_obj8.getPrimaryKey().equals(obj8.getPrimaryKey()))
3695                {
3696                    newObject = false;
3697                                    temp_obj8.addActivityRelatedByNewOptionId(obj1);
3698                                    break;
3699                }
3700            }
3701                            if (newObject)
3702            {
3703                obj8.initActivitysRelatedByNewOptionId();
3704                obj8.addActivityRelatedByNewOptionId(obj1);
3705            }
3706                                                                                    
3707                                                        
3708                            
3709              
3710                           omClass = AttachmentPeer.getOMClass();
3711                          Attachment obj9 = (Attachment)AttachmentPeer
3712                .row2Object( row, offset9, omClass);
3713
3714               newObject = true;
3715            for (int j = 0; j < results.size(); j++)
3716            {
3717                Activity temp_obj1 = (Activity)results.get(j);
3718                Attachment temp_obj9 = (Attachment)temp_obj1.getAttachment();
3719                if (temp_obj9.getPrimaryKey().equals(obj9.getPrimaryKey()))
3720                {
3721                    newObject = false;
3722                                    temp_obj9.addActivity(obj1);
3723                                    break;
3724                }
3725            }
3726                            if (newObject)
3727            {
3728                obj9.initActivitys();
3729                obj9.addActivity(obj1);
3730            }
3731                                                                                    
3732                                              results.add(obj1);
3733        }
3734        return results;
3735    }
3736                    
3737  
3738      /**
3739     * Returns the TableMap related to this peer. This method is not
3740     * needed for general use but a specific application could have a need.
3741     *
3742     * @throws TorqueException Any exceptions caught during processing will be
3743     * rethrown wrapped into a TorqueException.
3744     */

3745    protected static TableMap getTableMap()
3746        throws TorqueException
3747    {
3748        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
3749    }
3750   
3751    private static void setDbName(Criteria crit)
3752    {
3753        // Set the correct dbName if it has not been overridden
3754
// crit.getDbName will return the same object if not set to
3755
// another value so == check is okay and faster
3756
if (crit.getDbName() == Torque.getDefaultDB())
3757        {
3758            crit.setDbName(DATABASE_NAME);
3759        }
3760    }
3761}
3762
Popular Tags