KickJava   Java API By Example, From Geeks To Geeks.

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


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 public abstract class BaseQueryPeer
43     extends BasePeer
44 {
45
46     /** the default database name for this class */
47     public static final String JavaDoc DATABASE_NAME = "scarab";
48
49      /** the table name for this class */
50     public static final String JavaDoc TABLE_NAME = "SCARAB_QUERY";
51
52     /**
53      * @return the map builder for this peer
54      * @throws TorqueException Any exceptions caught during processing will be
55      * rethrown wrapped into a TorqueException.
56      */

57     public static MapBuilder getMapBuilder()
58         throws TorqueException
59     {
60         return getMapBuilder(QueryMapBuilder.CLASS_NAME);
61     }
62
63       /** the column name for the QUERY_ID field */
64     public static final String JavaDoc QUERY_ID;
65       /** the column name for the USER_ID field */
66     public static final String JavaDoc USER_ID;
67       /** the column name for the NAME field */
68     public static final String JavaDoc NAME;
69       /** the column name for the DESCRIPTION field */
70     public static final String JavaDoc DESCRIPTION;
71       /** the column name for the VALUE field */
72     public static final String JavaDoc VALUE;
73       /** the column name for the SCOPE_ID field */
74     public static final String JavaDoc SCOPE_ID;
75       /** the column name for the ISSUE_TYPE_ID field */
76     public static final String JavaDoc ISSUE_TYPE_ID;
77       /** the column name for the MODULE_ID field */
78     public static final String JavaDoc MODULE_ID;
79       /** the column name for the LIST_ID field */
80     public static final String JavaDoc LIST_ID;
81       /** the column name for the DELETED field */
82     public static final String JavaDoc DELETED;
83       /** the column name for the APPROVED field */
84     public static final String JavaDoc APPROVED;
85       /** the column name for the CREATED_DATE field */
86     public static final String JavaDoc CREATED_DATE;
87       /** the column name for the SUBSCRIPTION_FREQUENCY_ID field */
88     public static final String JavaDoc SUBSCRIPTION_FREQUENCY_ID;
89       /** the column name for the HOME_PAGE field */
90     public static final String JavaDoc HOME_PAGE;
91       /** the column name for the PREFERRED_ORDER field */
92     public static final String JavaDoc PREFERRED_ORDER;
93   
94     static
95     {
96           QUERY_ID = "SCARAB_QUERY.QUERY_ID";
97           USER_ID = "SCARAB_QUERY.USER_ID";
98           NAME = "SCARAB_QUERY.NAME";
99           DESCRIPTION = "SCARAB_QUERY.DESCRIPTION";
100           VALUE = "SCARAB_QUERY.VALUE";
101           SCOPE_ID = "SCARAB_QUERY.SCOPE_ID";
102           ISSUE_TYPE_ID = "SCARAB_QUERY.ISSUE_TYPE_ID";
103           MODULE_ID = "SCARAB_QUERY.MODULE_ID";
104           LIST_ID = "SCARAB_QUERY.LIST_ID";
105           DELETED = "SCARAB_QUERY.DELETED";
106           APPROVED = "SCARAB_QUERY.APPROVED";
107           CREATED_DATE = "SCARAB_QUERY.CREATED_DATE";
108           SUBSCRIPTION_FREQUENCY_ID = "SCARAB_QUERY.SUBSCRIPTION_FREQUENCY_ID";
109           HOME_PAGE = "SCARAB_QUERY.HOME_PAGE";
110           PREFERRED_ORDER = "SCARAB_QUERY.PREFERRED_ORDER";
111           if (Torque.isInit())
112         {
113             try
114             {
115                 getMapBuilder(QueryMapBuilder.CLASS_NAME);
116             }
117             catch (Exception JavaDoc e)
118             {
119                 log.error("Could not initialize Peer", e);
120             }
121         }
122         else
123         {
124             Torque.registerMapBuilder(QueryMapBuilder.CLASS_NAME);
125         }
126     }
127  
128     /** number of columns for this peer */
129     public static final int numColumns = 15;
130
131     /** A class that can be returned by this peer. */
132     protected static final String JavaDoc CLASSNAME_DEFAULT =
133         "org.tigris.scarab.om.Query";
134
135     /** A class that can be returned by this peer. */
136     protected static final Class JavaDoc CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
137
138     /**
139      * Class object initialization method.
140      *
141      * @param className name of the class to initialize
142      * @return the initialized class
143      */

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

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

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

236     public static ObjectKey doInsert(Criteria criteria, Connection JavaDoc con)
237         throws TorqueException
238     {
239                                                                     // check for conversion from boolean to int
240
if (criteria.containsKey(DELETED))
241         {
242             Object JavaDoc possibleBoolean = criteria.get(DELETED);
243             if (possibleBoolean instanceof Boolean JavaDoc)
244             {
245                 criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
246             }
247          }
248                   // check for conversion from boolean to int
249
if (criteria.containsKey(APPROVED))
250         {
251             Object JavaDoc possibleBoolean = criteria.get(APPROVED);
252             if (possibleBoolean instanceof Boolean JavaDoc)
253             {
254                 criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
255             }
256          }
257                               // check for conversion from boolean to int
258
if (criteria.containsKey(HOME_PAGE))
259         {
260             Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
261             if (possibleBoolean instanceof Boolean JavaDoc)
262             {
263                 criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
264             }
265          }
266             
267         setDbName(criteria);
268
269         if (con == null)
270         {
271             return BasePeer.doInsert(criteria);
272         }
273         else
274         {
275             return BasePeer.doInsert(criteria, con);
276         }
277     }
278
279     /**
280      * Add all the columns needed to create a new object.
281      *
282      * @param criteria object containing the columns to add.
283      * @throws TorqueException Any exceptions caught during processing will be
284      * rethrown wrapped into a TorqueException.
285      */

286     public static void addSelectColumns(Criteria criteria)
287             throws TorqueException
288     {
289           criteria.addSelectColumn(QUERY_ID);
290           criteria.addSelectColumn(USER_ID);
291           criteria.addSelectColumn(NAME);
292           criteria.addSelectColumn(DESCRIPTION);
293           criteria.addSelectColumn(VALUE);
294           criteria.addSelectColumn(SCOPE_ID);
295           criteria.addSelectColumn(ISSUE_TYPE_ID);
296           criteria.addSelectColumn(MODULE_ID);
297           criteria.addSelectColumn(LIST_ID);
298           criteria.addSelectColumn(DELETED);
299           criteria.addSelectColumn(APPROVED);
300           criteria.addSelectColumn(CREATED_DATE);
301           criteria.addSelectColumn(SUBSCRIPTION_FREQUENCY_ID);
302           criteria.addSelectColumn(HOME_PAGE);
303           criteria.addSelectColumn(PREFERRED_ORDER);
304       }
305
306     /**
307      * Create a new object of type cls from a resultset row starting
308      * from a specified offset. This is done so that you can select
309      * other rows than just those needed for this object. You may
310      * for example want to create two objects from the same row.
311      *
312      * @throws TorqueException Any exceptions caught during processing will be
313      * rethrown wrapped into a TorqueException.
314      */

315     public static Query row2Object(Record row,
316                                              int offset,
317                                              Class JavaDoc cls)
318         throws TorqueException
319     {
320         try
321         {
322             Query obj = (Query) cls.newInstance();
323             QueryPeer.populateObject(row, offset, obj);
324                   obj.setModified(false);
325               obj.setNew(false);
326
327             return obj;
328         }
329         catch (InstantiationException JavaDoc e)
330         {
331             throw new TorqueException(e);
332         }
333         catch (IllegalAccessException JavaDoc e)
334         {
335             throw new TorqueException(e);
336         }
337     }
338
339     /**
340      * Populates an object from a resultset row starting
341      * from a specified offset. This is done so that you can select
342      * other rows than just those needed for this object. You may
343      * for example want to create two objects from the same row.
344      *
345      * @throws TorqueException Any exceptions caught during processing will be
346      * rethrown wrapped into a TorqueException.
347      */

348     public static void populateObject(Record row,
349                                       int offset,
350                                       Query obj)
351         throws TorqueException
352     {
353         try
354         {
355                 obj.setQueryId(row.getValue(offset + 0).asLongObj());
356                   obj.setUserId(row.getValue(offset + 1).asIntegerObj());
357                   obj.setName(row.getValue(offset + 2).asString());
358                   obj.setDescription(row.getValue(offset + 3).asString());
359                   obj.setValue(row.getValue(offset + 4).asString());
360                   obj.setScopeId(row.getValue(offset + 5).asIntegerObj());
361                   obj.setIssueTypeId(row.getValue(offset + 6).asIntegerObj());
362                   obj.setModuleId(row.getValue(offset + 7).asIntegerObj());
363                   obj.setListId(row.getValue(offset + 8).asLongObj());
364                   obj.setDeleted(row.getValue(offset + 9).asBoolean());
365                   obj.setApproved(row.getValue(offset + 10).asBoolean());
366                   obj.setCreatedDate(row.getValue(offset + 11).asUtilDate());
367                   obj.setSubscriptionFrequencyId(row.getValue(offset + 12).asIntegerObj());
368                   obj.setHomePage(row.getValue(offset + 13).asBoolean());
369                   obj.setOrder(row.getValue(offset + 14).asInt());
370               }
371         catch (DataSetException e)
372         {
373             throw new TorqueException(e);
374         }
375     }
376
377     /**
378      * Method to do selects.
379      *
380      * @param criteria object used to create the SELECT statement.
381      * @return List of selected Objects
382      * @throws TorqueException Any exceptions caught during processing will be
383      * rethrown wrapped into a TorqueException.
384      */

385     public static List JavaDoc doSelect(Criteria criteria) throws TorqueException
386     {
387         return populateObjects(doSelectVillageRecords(criteria));
388     }
389
390     /**
391      * Method to do selects within a transaction.
392      *
393      * @param criteria object used to create the SELECT statement.
394      * @param con the connection to use
395      * @return List of selected Objects
396      * @throws TorqueException Any exceptions caught during processing will be
397      * rethrown wrapped into a TorqueException.
398      */

399     public static List JavaDoc doSelect(Criteria criteria, Connection JavaDoc con)
400         throws TorqueException
401     {
402         return populateObjects(doSelectVillageRecords(criteria, con));
403     }
404
405     /**
406      * Grabs the raw Village records to be formed into objects.
407      * This method handles connections internally. The Record objects
408      * returned by this method should be considered readonly. Do not
409      * alter the data and call save(), your results may vary, but are
410      * certainly likely to result in hard to track MT bugs.
411      *
412      * @throws TorqueException Any exceptions caught during processing will be
413      * rethrown wrapped into a TorqueException.
414      */

415     public static List JavaDoc doSelectVillageRecords(Criteria criteria)
416         throws TorqueException
417     {
418         return BaseQueryPeer
419             .doSelectVillageRecords(criteria, (Connection JavaDoc) null);
420     }
421
422     /**
423      * Grabs the raw Village records to be formed into objects.
424      * This method should be used for transactions
425      *
426      * @param criteria object used to create the SELECT statement.
427      * @param con the connection to use
428      * @throws TorqueException Any exceptions caught during processing will be
429      * rethrown wrapped into a TorqueException.
430      */

431     public static List JavaDoc doSelectVillageRecords(Criteria criteria, Connection JavaDoc con)
432         throws TorqueException
433     {
434         if (criteria.getSelectColumns().size() == 0)
435         {
436             addSelectColumns(criteria);
437         }
438
439                                                                     // check for conversion from boolean to int
440
if (criteria.containsKey(DELETED))
441         {
442             Object JavaDoc possibleBoolean = criteria.get(DELETED);
443             if (possibleBoolean instanceof Boolean JavaDoc)
444             {
445                 criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
446             }
447          }
448                   // check for conversion from boolean to int
449
if (criteria.containsKey(APPROVED))
450         {
451             Object JavaDoc possibleBoolean = criteria.get(APPROVED);
452             if (possibleBoolean instanceof Boolean JavaDoc)
453             {
454                 criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
455             }
456          }
457                               // check for conversion from boolean to int
458
if (criteria.containsKey(HOME_PAGE))
459         {
460             Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
461             if (possibleBoolean instanceof Boolean JavaDoc)
462             {
463                 criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
464             }
465          }
466             
467         setDbName(criteria);
468
469         // BasePeer returns a List of Value (Village) arrays. The array
470
// order follows the order columns were placed in the Select clause.
471
if (con == null)
472         {
473             return BasePeer.doSelect(criteria);
474         }
475         else
476         {
477             return BasePeer.doSelect(criteria, con);
478         }
479     }
480
481     /**
482      * The returned List will contain objects of the default type or
483      * objects that inherit from the default.
484      *
485      * @throws TorqueException Any exceptions caught during processing will be
486      * rethrown wrapped into a TorqueException.
487      */

488     public static List JavaDoc populateObjects(List JavaDoc records)
489         throws TorqueException
490     {
491         List JavaDoc results = new ArrayList JavaDoc(records.size());
492
493         // populate the object(s)
494
for (int i = 0; i < records.size(); i++)
495         {
496             Record row = (Record) records.get(i);
497               results.add(QueryPeer.row2Object(row, 1,
498                 QueryPeer.getOMClass()));
499           }
500         return results;
501     }
502  
503
504     /**
505      * The class that the Peer will make instances of.
506      * If the BO is abstract then you must implement this method
507      * in the BO.
508      *
509      * @throws TorqueException Any exceptions caught during processing will be
510      * rethrown wrapped into a TorqueException.
511      */

512     public static Class JavaDoc getOMClass()
513         throws TorqueException
514     {
515         return CLASS_DEFAULT;
516     }
517
518     /**
519      * Method to do updates.
520      *
521      * @param criteria object containing data that is used to create the UPDATE
522      * statement.
523      * @throws TorqueException Any exceptions caught during processing will be
524      * rethrown wrapped into a TorqueException.
525      */

526     public static void doUpdate(Criteria criteria) throws TorqueException
527     {
528          BaseQueryPeer
529             .doUpdate(criteria, (Connection JavaDoc) null);
530     }
531
532     /**
533      * Method to do updates. This method is to be used during a transaction,
534      * otherwise use the doUpdate(Criteria) method. It will take care of
535      * the connection details internally.
536      *
537      * @param criteria object containing data that is used to create the UPDATE
538      * statement.
539      * @param con the connection to use
540      * @throws TorqueException Any exceptions caught during processing will be
541      * rethrown wrapped into a TorqueException.
542      */

543     public static void doUpdate(Criteria criteria, Connection JavaDoc con)
544         throws TorqueException
545     {
546         Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
547                    selectCriteria.put(QUERY_ID, criteria.remove(QUERY_ID));
548                                                                                                   // check for conversion from boolean to int
549
if (criteria.containsKey(DELETED))
550         {
551             Object JavaDoc possibleBoolean = criteria.get(DELETED);
552             if (possibleBoolean instanceof Boolean JavaDoc)
553             {
554                 criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
555             }
556          }
557                       // check for conversion from boolean to int
558
if (criteria.containsKey(APPROVED))
559         {
560             Object JavaDoc possibleBoolean = criteria.get(APPROVED);
561             if (possibleBoolean instanceof Boolean JavaDoc)
562             {
563                 criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
564             }
565          }
566                                           // check for conversion from boolean to int
567
if (criteria.containsKey(HOME_PAGE))
568         {
569             Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
570             if (possibleBoolean instanceof Boolean JavaDoc)
571             {
572                 criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
573             }
574          }
575                     
576         setDbName(criteria);
577
578         if (con == null)
579         {
580             BasePeer.doUpdate(selectCriteria, criteria);
581         }
582         else
583         {
584             BasePeer.doUpdate(selectCriteria, criteria, con);
585         }
586     }
587
588     /**
589      * Method to do deletes.
590      *
591      * @param criteria object containing data that is used DELETE from database.
592      * @throws TorqueException Any exceptions caught during processing will be
593      * rethrown wrapped into a TorqueException.
594      */

595      public static void doDelete(Criteria criteria) throws TorqueException
596      {
597          QueryPeer
598             .doDelete(criteria, (Connection JavaDoc) null);
599      }
600
601     /**
602      * Method to do deletes. This method is to be used during a transaction,
603      * otherwise use the doDelete(Criteria) method. It will take care of
604      * the connection details internally.
605      *
606      * @param criteria object containing data that is used DELETE from database.
607      * @param con the connection to use
608      * @throws TorqueException Any exceptions caught during processing will be
609      * rethrown wrapped into a TorqueException.
610      */

611      public static void doDelete(Criteria criteria, Connection JavaDoc con)
612         throws TorqueException
613      {
614                                                                     // check for conversion from boolean to int
615
if (criteria.containsKey(DELETED))
616         {
617             Object JavaDoc possibleBoolean = criteria.get(DELETED);
618             if (possibleBoolean instanceof Boolean JavaDoc)
619             {
620                 criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
621             }
622          }
623                   // check for conversion from boolean to int
624
if (criteria.containsKey(APPROVED))
625         {
626             Object JavaDoc possibleBoolean = criteria.get(APPROVED);
627             if (possibleBoolean instanceof Boolean JavaDoc)
628             {
629                 criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
630             }
631          }
632                               // check for conversion from boolean to int
633
if (criteria.containsKey(HOME_PAGE))
634         {
635             Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
636             if (possibleBoolean instanceof Boolean JavaDoc)
637             {
638                 criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
639             }
640          }
641             
642         setDbName(criteria);
643
644         if (con == null)
645         {
646             BasePeer.doDelete(criteria);
647         }
648         else
649         {
650             BasePeer.doDelete(criteria, con);
651         }
652      }
653
654     /**
655      * Method to do selects
656      *
657      * @throws TorqueException Any exceptions caught during processing will be
658      * rethrown wrapped into a TorqueException.
659      */

660     public static List JavaDoc doSelect(Query obj) throws TorqueException
661     {
662         return doSelect(buildSelectCriteria(obj));
663     }
664
665     /**
666      * Method to do inserts
667      *
668      * @throws TorqueException Any exceptions caught during processing will be
669      * rethrown wrapped into a TorqueException.
670      */

671     public static void doInsert(Query obj) throws TorqueException
672     {
673           obj.setPrimaryKey(doInsert(buildCriteria(obj)));
674           obj.setNew(false);
675         obj.setModified(false);
676     }
677
678     /**
679      * @param obj the data object to update in the database.
680      * @throws TorqueException Any exceptions caught during processing will be
681      * rethrown wrapped into a TorqueException.
682      */

683     public static void doUpdate(Query obj) throws TorqueException
684     {
685         doUpdate(buildCriteria(obj));
686         obj.setModified(false);
687     }
688
689     /**
690      * @param obj the data object to delete in the database.
691      * @throws TorqueException Any exceptions caught during processing will be
692      * rethrown wrapped into a TorqueException.
693      */

694     public static void doDelete(Query obj) throws TorqueException
695     {
696         doDelete(buildSelectCriteria(obj));
697     }
698
699     /**
700      * Method to do inserts. This method is to be used during a transaction,
701      * otherwise use the doInsert(Query) method. It will take
702      * care of the connection details internally.
703      *
704      * @param obj the data object to insert into the database.
705      * @param con the connection to use
706      * @throws TorqueException Any exceptions caught during processing will be
707      * rethrown wrapped into a TorqueException.
708      */

709     public static void doInsert(Query obj, Connection JavaDoc con)
710         throws TorqueException
711     {
712           obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
713           obj.setNew(false);
714         obj.setModified(false);
715     }
716
717     /**
718      * Method to do update. This method is to be used during a transaction,
719      * otherwise use the doUpdate(Query) method. It will take
720      * care of the connection details internally.
721      *
722      * @param obj the data object to update in the database.
723      * @param con the connection to use
724      * @throws TorqueException Any exceptions caught during processing will be
725      * rethrown wrapped into a TorqueException.
726      */

727     public static void doUpdate(Query obj, Connection JavaDoc con)
728         throws TorqueException
729     {
730         doUpdate(buildCriteria(obj), con);
731         obj.setModified(false);
732     }
733
734     /**
735      * Method to delete. This method is to be used during a transaction,
736      * otherwise use the doDelete(Query) method. It will take
737      * care of the connection details internally.
738      *
739      * @param obj the data object to delete in the database.
740      * @param con the connection to use
741      * @throws TorqueException Any exceptions caught during processing will be
742      * rethrown wrapped into a TorqueException.
743      */

744     public static void doDelete(Query obj, Connection JavaDoc con)
745         throws TorqueException
746     {
747         doDelete(buildSelectCriteria(obj), con);
748     }
749
750     /**
751      * Method to do deletes.
752      *
753      * @param pk ObjectKey that is used DELETE from database.
754      * @throws TorqueException Any exceptions caught during processing will be
755      * rethrown wrapped into a TorqueException.
756      */

757     public static void doDelete(ObjectKey pk) throws TorqueException
758     {
759         BaseQueryPeer
760            .doDelete(pk, (Connection JavaDoc) null);
761     }
762
763     /**
764      * Method to delete. This method is to be used during a transaction,
765      * otherwise use the doDelete(ObjectKey) method. It will take
766      * care of the connection details internally.
767      *
768      * @param pk the primary key for the object to delete in the database.
769      * @param con the connection to use
770      * @throws TorqueException Any exceptions caught during processing will be
771      * rethrown wrapped into a TorqueException.
772      */

773     public static void doDelete(ObjectKey pk, Connection JavaDoc con)
774         throws TorqueException
775     {
776         doDelete(buildCriteria(pk), con);
777     }
778
779     /** Build a Criteria object from an ObjectKey */
780     public static Criteria buildCriteria( ObjectKey pk )
781     {
782         Criteria criteria = new Criteria();
783               criteria.add(QUERY_ID, pk);
784           return criteria;
785      }
786
787     /** Build a Criteria object from the data object for this peer */
788     public static Criteria buildCriteria( Query obj )
789     {
790         Criteria criteria = new Criteria(DATABASE_NAME);
791               if (!obj.isNew())
792             criteria.add(QUERY_ID, obj.getQueryId());
793               criteria.add(USER_ID, obj.getUserId());
794               criteria.add(NAME, obj.getName());
795               criteria.add(DESCRIPTION, obj.getDescription());
796               criteria.add(VALUE, obj.getValue());
797               criteria.add(SCOPE_ID, obj.getScopeId());
798               criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId());
799               criteria.add(MODULE_ID, obj.getModuleId());
800               criteria.add(LIST_ID, obj.getListId());
801               criteria.add(DELETED, obj.getDeleted());
802               criteria.add(APPROVED, obj.getApproved());
803               criteria.add(CREATED_DATE, obj.getCreatedDate());
804               criteria.add(SUBSCRIPTION_FREQUENCY_ID, obj.getSubscriptionFrequencyId());
805               criteria.add(HOME_PAGE, obj.getHomePage());
806               criteria.add(PREFERRED_ORDER, obj.getOrder());
807           return criteria;
808     }
809
810     /** Build a Criteria object from the data object for this peer, skipping all binary columns */
811     public static Criteria buildSelectCriteria( Query obj )
812     {
813         Criteria criteria = new Criteria(DATABASE_NAME);
814               if (!obj.isNew())
815                     criteria.add(QUERY_ID, obj.getQueryId());
816                           criteria.add(USER_ID, obj.getUserId());
817                           criteria.add(NAME, obj.getName());
818                           criteria.add(DESCRIPTION, obj.getDescription());
819                           criteria.add(VALUE, obj.getValue());
820                           criteria.add(SCOPE_ID, obj.getScopeId());
821                           criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId());
822                           criteria.add(MODULE_ID, obj.getModuleId());
823                           criteria.add(LIST_ID, obj.getListId());
824                           criteria.add(DELETED, obj.getDeleted());
825                           criteria.add(APPROVED, obj.getApproved());
826                           criteria.add(CREATED_DATE, obj.getCreatedDate());
827                           criteria.add(SUBSCRIPTION_FREQUENCY_ID, obj.getSubscriptionFrequencyId());
828                           criteria.add(HOME_PAGE, obj.getHomePage());
829                           criteria.add(PREFERRED_ORDER, obj.getOrder());
830               return criteria;
831     }
832  
833     
834         /**
835      * Retrieve a single object by pk
836      *
837      * @param pk the primary key
838      * @throws TorqueException Any exceptions caught during processing will be
839      * rethrown wrapped into a TorqueException.
840      * @throws NoRowsException Primary key was not found in database.
841      * @throws TooManyRowsException Primary key was not found in database.
842      */

843     public static Query retrieveByPK(Long JavaDoc pk)
844         throws TorqueException, NoRowsException, TooManyRowsException
845     {
846         return retrieveByPK(SimpleKey.keyFor(pk));
847     }
848
849     /**
850      * Retrieve a single object by pk
851      *
852      * @param pk the primary key
853      * @param con the connection to use
854      * @throws TorqueException Any exceptions caught during processing will be
855      * rethrown wrapped into a TorqueException.
856      * @throws NoRowsException Primary key was not found in database.
857      * @throws TooManyRowsException Primary key was not found in database.
858      */

859     public static Query retrieveByPK(Long JavaDoc pk, Connection JavaDoc con)
860         throws TorqueException, NoRowsException, TooManyRowsException
861     {
862         return retrieveByPK(SimpleKey.keyFor(pk), con);
863     }
864   
865     /**
866      * Retrieve a single object by pk
867      *
868      * @param pk the primary key
869      * @throws TorqueException Any exceptions caught during processing will be
870      * rethrown wrapped into a TorqueException.
871      * @throws NoRowsException Primary key was not found in database.
872      * @throws TooManyRowsException Primary key was not found in database.
873      */

874     public static Query retrieveByPK(ObjectKey pk)
875         throws TorqueException, NoRowsException, TooManyRowsException
876     {
877         Connection JavaDoc db = null;
878         Query retVal = null;
879         try
880         {
881             db = Torque.getConnection(DATABASE_NAME);
882             retVal = retrieveByPK(pk, db);
883         }
884         finally
885         {
886             Torque.closeConnection(db);
887         }
888         return(retVal);
889     }
890
891     /**
892      * Retrieve a single object by pk
893      *
894      * @param pk the primary key
895      * @param con the connection to use
896      * @throws TorqueException Any exceptions caught during processing will be
897      * rethrown wrapped into a TorqueException.
898      * @throws NoRowsException Primary key was not found in database.
899      * @throws TooManyRowsException Primary key was not found in database.
900      */

901     public static Query retrieveByPK(ObjectKey pk, Connection JavaDoc con)
902         throws TorqueException, NoRowsException, TooManyRowsException
903     {
904         Criteria criteria = buildCriteria(pk);
905         List JavaDoc v = doSelect(criteria, con);
906         if (v.size() == 0)
907         {
908             throw new NoRowsException("Failed to select a row.");
909         }
910         else if (v.size() > 1)
911         {
912             throw new TooManyRowsException("Failed to select only one row.");
913         }
914         else
915         {
916             return (Query)v.get(0);
917         }
918     }
919
920     /**
921      * Retrieve a multiple objects by pk
922      *
923      * @param pks List of primary keys
924      * @throws TorqueException Any exceptions caught during processing will be
925      * rethrown wrapped into a TorqueException.
926      */

927     public static List JavaDoc retrieveByPKs(List JavaDoc pks)
928         throws TorqueException
929     {
930         Connection JavaDoc db = null;
931         List JavaDoc retVal = null;
932         try
933         {
934            db = Torque.getConnection(DATABASE_NAME);
935            retVal = retrieveByPKs(pks, db);
936         }
937         finally
938         {
939             Torque.closeConnection(db);
940         }
941         return(retVal);
942     }
943
944     /**
945      * Retrieve a multiple objects by pk
946      *
947      * @param pks List of primary keys
948      * @param dbcon the connection to use
949      * @throws TorqueException Any exceptions caught during processing will be
950      * rethrown wrapped into a TorqueException.
951      */

952     public static List JavaDoc retrieveByPKs( List JavaDoc pks, Connection JavaDoc dbcon )
953         throws TorqueException
954     {
955         List JavaDoc objs = null;
956         if (pks == null || pks.size() == 0)
957         {
958             objs = new LinkedList JavaDoc();
959         }
960         else
961         {
962             Criteria criteria = new Criteria();
963               criteria.addIn( QUERY_ID, pks );
964           objs = doSelect(criteria, dbcon);
965         }
966         return objs;
967     }
968
969  
970
971
972
973                     
974                                               
975                         
976                 
977
978     /**
979      * selects a collection of Query objects pre-filled with their
980      * ScarabUserImpl objects.
981      *
982      * This method is protected by default in order to keep the public
983      * api reasonable. You can provide public methods for those you
984      * actually need in QueryPeer.
985      *
986      * @throws TorqueException Any exceptions caught during processing will be
987      * rethrown wrapped into a TorqueException.
988      */

989     protected static List JavaDoc doSelectJoinScarabUserImpl(Criteria criteria)
990         throws TorqueException
991     {
992         setDbName(criteria);
993
994         QueryPeer.addSelectColumns(criteria);
995         int offset = numColumns + 1;
996         ScarabUserImplPeer.addSelectColumns(criteria);
997
998
999                         criteria.addJoin(QueryPeer.USER_ID,
1000            ScarabUserImplPeer.USER_ID);
1001        
1002
1003                                                                                                                                                                                            // check for conversion from boolean to int
1004
if (criteria.containsKey(DELETED))
1005        {
1006            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1007            if (possibleBoolean instanceof Boolean JavaDoc)
1008            {
1009                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1010            }
1011         }
1012                                    // check for conversion from boolean to int
1013
if (criteria.containsKey(APPROVED))
1014        {
1015            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1016            if (possibleBoolean instanceof Boolean JavaDoc)
1017            {
1018                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1019            }
1020         }
1021                                                                        // check for conversion from boolean to int
1022
if (criteria.containsKey(HOME_PAGE))
1023        {
1024            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1025            if (possibleBoolean instanceof Boolean JavaDoc)
1026            {
1027                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1028            }
1029         }
1030                                    
1031        List JavaDoc rows = BasePeer.doSelect(criteria);
1032        List JavaDoc results = new ArrayList JavaDoc();
1033
1034        for (int i = 0; i < rows.size(); i++)
1035        {
1036            Record row = (Record) rows.get(i);
1037
1038                            Class JavaDoc omClass = QueryPeer.getOMClass();
1039                    Query obj1 = (Query) QueryPeer
1040                .row2Object(row, 1, omClass);
1041                     omClass = ScarabUserImplPeer.getOMClass();
1042                    ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
1043                .row2Object(row, offset, omClass);
1044
1045            boolean newObject = true;
1046            for (int j = 0; j < results.size(); j++)
1047            {
1048                Query temp_obj1 = (Query)results.get(j);
1049                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser();
1050                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1051                {
1052                    newObject = false;
1053                              temp_obj2.addQuery(obj1);
1054                              break;
1055                }
1056            }
1057                      if (newObject)
1058            {
1059                obj2.initQuerys();
1060                obj2.addQuery(obj1);
1061            }
1062                      results.add(obj1);
1063        }
1064        return results;
1065    }
1066                                                            
1067                
1068                
1069
1070    /**
1071     * selects a collection of Query objects pre-filled with their
1072     * Scope objects.
1073     *
1074     * This method is protected by default in order to keep the public
1075     * api reasonable. You can provide public methods for those you
1076     * actually need in QueryPeer.
1077     *
1078     * @throws TorqueException Any exceptions caught during processing will be
1079     * rethrown wrapped into a TorqueException.
1080     */

1081    protected static List JavaDoc doSelectJoinScope(Criteria criteria)
1082        throws TorqueException
1083    {
1084        setDbName(criteria);
1085
1086        QueryPeer.addSelectColumns(criteria);
1087        int offset = numColumns + 1;
1088        ScopePeer.addSelectColumns(criteria);
1089
1090
1091                        criteria.addJoin(QueryPeer.SCOPE_ID,
1092            ScopePeer.SCOPE_ID);
1093        
1094
1095                                                                                                                                                                                            // check for conversion from boolean to int
1096
if (criteria.containsKey(DELETED))
1097        {
1098            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1099            if (possibleBoolean instanceof Boolean JavaDoc)
1100            {
1101                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1102            }
1103         }
1104                                    // check for conversion from boolean to int
1105
if (criteria.containsKey(APPROVED))
1106        {
1107            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1108            if (possibleBoolean instanceof Boolean JavaDoc)
1109            {
1110                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1111            }
1112         }
1113                                                                        // check for conversion from boolean to int
1114
if (criteria.containsKey(HOME_PAGE))
1115        {
1116            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1117            if (possibleBoolean instanceof Boolean JavaDoc)
1118            {
1119                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1120            }
1121         }
1122                                    
1123        List JavaDoc rows = BasePeer.doSelect(criteria);
1124        List JavaDoc results = new ArrayList JavaDoc();
1125
1126        for (int i = 0; i < rows.size(); i++)
1127        {
1128            Record row = (Record) rows.get(i);
1129
1130                            Class JavaDoc omClass = QueryPeer.getOMClass();
1131                    Query obj1 = (Query) QueryPeer
1132                .row2Object(row, 1, omClass);
1133                     omClass = ScopePeer.getOMClass();
1134                    Scope obj2 = (Scope)ScopePeer
1135                .row2Object(row, offset, omClass);
1136
1137            boolean newObject = true;
1138            for (int j = 0; j < results.size(); j++)
1139            {
1140                Query temp_obj1 = (Query)results.get(j);
1141                Scope temp_obj2 = (Scope)temp_obj1.getScope();
1142                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1143                {
1144                    newObject = false;
1145                              temp_obj2.addQuery(obj1);
1146                              break;
1147                }
1148            }
1149                      if (newObject)
1150            {
1151                obj2.initQuerys();
1152                obj2.addQuery(obj1);
1153            }
1154                      results.add(obj1);
1155        }
1156        return results;
1157    }
1158                                                            
1159                        
1160                
1161
1162    /**
1163     * selects a collection of Query objects pre-filled with their
1164     * ScarabModule objects.
1165     *
1166     * This method is protected by default in order to keep the public
1167     * api reasonable. You can provide public methods for those you
1168     * actually need in QueryPeer.
1169     *
1170     * @throws TorqueException Any exceptions caught during processing will be
1171     * rethrown wrapped into a TorqueException.
1172     */

1173    protected static List JavaDoc doSelectJoinScarabModule(Criteria criteria)
1174        throws TorqueException
1175    {
1176        setDbName(criteria);
1177
1178        QueryPeer.addSelectColumns(criteria);
1179        int offset = numColumns + 1;
1180        ScarabModulePeer.addSelectColumns(criteria);
1181
1182
1183                        criteria.addJoin(QueryPeer.MODULE_ID,
1184            ScarabModulePeer.MODULE_ID);
1185        
1186
1187                                                                                                                                                                                            // check for conversion from boolean to int
1188
if (criteria.containsKey(DELETED))
1189        {
1190            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1191            if (possibleBoolean instanceof Boolean JavaDoc)
1192            {
1193                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1194            }
1195         }
1196                                    // check for conversion from boolean to int
1197
if (criteria.containsKey(APPROVED))
1198        {
1199            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1200            if (possibleBoolean instanceof Boolean JavaDoc)
1201            {
1202                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1203            }
1204         }
1205                                                                        // check for conversion from boolean to int
1206
if (criteria.containsKey(HOME_PAGE))
1207        {
1208            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1209            if (possibleBoolean instanceof Boolean JavaDoc)
1210            {
1211                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1212            }
1213         }
1214                                    
1215        List JavaDoc rows = BasePeer.doSelect(criteria);
1216        List JavaDoc results = new ArrayList JavaDoc();
1217
1218        for (int i = 0; i < rows.size(); i++)
1219        {
1220            Record row = (Record) rows.get(i);
1221
1222                            Class JavaDoc omClass = QueryPeer.getOMClass();
1223                    Query obj1 = (Query) QueryPeer
1224                .row2Object(row, 1, omClass);
1225                     omClass = ScarabModulePeer.getOMClass(row, offset);
1226                    ScarabModule obj2 = (ScarabModule)ScarabModulePeer
1227                .row2Object(row, offset, omClass);
1228
1229            boolean newObject = true;
1230            for (int j = 0; j < results.size(); j++)
1231            {
1232                Query temp_obj1 = (Query)results.get(j);
1233                ScarabModule temp_obj2 = (ScarabModule)temp_obj1.getModule();
1234                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1235                {
1236                    newObject = false;
1237                              temp_obj2.addQuery(obj1);
1238                              break;
1239                }
1240            }
1241                      if (newObject)
1242            {
1243                obj2.initQuerys();
1244                obj2.addQuery(obj1);
1245            }
1246                      results.add(obj1);
1247        }
1248        return results;
1249    }
1250                                                            
1251                
1252                
1253
1254    /**
1255     * selects a collection of Query objects pre-filled with their
1256     * IssueType objects.
1257     *
1258     * This method is protected by default in order to keep the public
1259     * api reasonable. You can provide public methods for those you
1260     * actually need in QueryPeer.
1261     *
1262     * @throws TorqueException Any exceptions caught during processing will be
1263     * rethrown wrapped into a TorqueException.
1264     */

1265    protected static List JavaDoc doSelectJoinIssueType(Criteria criteria)
1266        throws TorqueException
1267    {
1268        setDbName(criteria);
1269
1270        QueryPeer.addSelectColumns(criteria);
1271        int offset = numColumns + 1;
1272        IssueTypePeer.addSelectColumns(criteria);
1273
1274
1275                        criteria.addJoin(QueryPeer.ISSUE_TYPE_ID,
1276            IssueTypePeer.ISSUE_TYPE_ID);
1277        
1278
1279                                                                                                                                                                                            // check for conversion from boolean to int
1280
if (criteria.containsKey(DELETED))
1281        {
1282            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1283            if (possibleBoolean instanceof Boolean JavaDoc)
1284            {
1285                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1286            }
1287         }
1288                                    // check for conversion from boolean to int
1289
if (criteria.containsKey(APPROVED))
1290        {
1291            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1292            if (possibleBoolean instanceof Boolean JavaDoc)
1293            {
1294                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1295            }
1296         }
1297                                                                        // check for conversion from boolean to int
1298
if (criteria.containsKey(HOME_PAGE))
1299        {
1300            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1301            if (possibleBoolean instanceof Boolean JavaDoc)
1302            {
1303                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1304            }
1305         }
1306                                    
1307        List JavaDoc rows = BasePeer.doSelect(criteria);
1308        List JavaDoc results = new ArrayList JavaDoc();
1309
1310        for (int i = 0; i < rows.size(); i++)
1311        {
1312            Record row = (Record) rows.get(i);
1313
1314                            Class JavaDoc omClass = QueryPeer.getOMClass();
1315                    Query obj1 = (Query) QueryPeer
1316                .row2Object(row, 1, omClass);
1317                     omClass = IssueTypePeer.getOMClass();
1318                    IssueType obj2 = (IssueType)IssueTypePeer
1319                .row2Object(row, offset, omClass);
1320
1321            boolean newObject = true;
1322            for (int j = 0; j < results.size(); j++)
1323            {
1324                Query temp_obj1 = (Query)results.get(j);
1325                IssueType temp_obj2 = (IssueType)temp_obj1.getIssueType();
1326                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1327                {
1328                    newObject = false;
1329                              temp_obj2.addQuery(obj1);
1330                              break;
1331                }
1332            }
1333                      if (newObject)
1334            {
1335                obj2.initQuerys();
1336                obj2.addQuery(obj1);
1337            }
1338                      results.add(obj1);
1339        }
1340        return results;
1341    }
1342                                                            
1343                
1344                
1345
1346    /**
1347     * selects a collection of Query objects pre-filled with their
1348     * MITList objects.
1349     *
1350     * This method is protected by default in order to keep the public
1351     * api reasonable. You can provide public methods for those you
1352     * actually need in QueryPeer.
1353     *
1354     * @throws TorqueException Any exceptions caught during processing will be
1355     * rethrown wrapped into a TorqueException.
1356     */

1357    protected static List JavaDoc doSelectJoinMITList(Criteria criteria)
1358        throws TorqueException
1359    {
1360        setDbName(criteria);
1361
1362        QueryPeer.addSelectColumns(criteria);
1363        int offset = numColumns + 1;
1364        MITListPeer.addSelectColumns(criteria);
1365
1366
1367                        criteria.addJoin(QueryPeer.LIST_ID,
1368            MITListPeer.LIST_ID);
1369        
1370
1371                                                                                                                                                                                            // check for conversion from boolean to int
1372
if (criteria.containsKey(DELETED))
1373        {
1374            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1375            if (possibleBoolean instanceof Boolean JavaDoc)
1376            {
1377                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1378            }
1379         }
1380                                    // check for conversion from boolean to int
1381
if (criteria.containsKey(APPROVED))
1382        {
1383            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1384            if (possibleBoolean instanceof Boolean JavaDoc)
1385            {
1386                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1387            }
1388         }
1389                                                                        // check for conversion from boolean to int
1390
if (criteria.containsKey(HOME_PAGE))
1391        {
1392            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1393            if (possibleBoolean instanceof Boolean JavaDoc)
1394            {
1395                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1396            }
1397         }
1398                                    
1399        List JavaDoc rows = BasePeer.doSelect(criteria);
1400        List JavaDoc results = new ArrayList JavaDoc();
1401
1402        for (int i = 0; i < rows.size(); i++)
1403        {
1404            Record row = (Record) rows.get(i);
1405
1406                            Class JavaDoc omClass = QueryPeer.getOMClass();
1407                    Query obj1 = (Query) QueryPeer
1408                .row2Object(row, 1, omClass);
1409                     omClass = MITListPeer.getOMClass();
1410                    MITList obj2 = (MITList)MITListPeer
1411                .row2Object(row, offset, omClass);
1412
1413            boolean newObject = true;
1414            for (int j = 0; j < results.size(); j++)
1415            {
1416                Query temp_obj1 = (Query)results.get(j);
1417                MITList temp_obj2 = (MITList)temp_obj1.getMITList();
1418                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1419                {
1420                    newObject = false;
1421                              temp_obj2.addQuery(obj1);
1422                              break;
1423                }
1424            }
1425                      if (newObject)
1426            {
1427                obj2.initQuerys();
1428                obj2.addQuery(obj1);
1429            }
1430                      results.add(obj1);
1431        }
1432        return results;
1433    }
1434                                                            
1435                
1436                
1437
1438    /**
1439     * selects a collection of Query objects pre-filled with their
1440     * Frequency objects.
1441     *
1442     * This method is protected by default in order to keep the public
1443     * api reasonable. You can provide public methods for those you
1444     * actually need in QueryPeer.
1445     *
1446     * @throws TorqueException Any exceptions caught during processing will be
1447     * rethrown wrapped into a TorqueException.
1448     */

1449    protected static List JavaDoc doSelectJoinFrequency(Criteria criteria)
1450        throws TorqueException
1451    {
1452        setDbName(criteria);
1453
1454        QueryPeer.addSelectColumns(criteria);
1455        int offset = numColumns + 1;
1456        FrequencyPeer.addSelectColumns(criteria);
1457
1458
1459                        criteria.addJoin(QueryPeer.SUBSCRIPTION_FREQUENCY_ID,
1460            FrequencyPeer.FREQUENCY_ID);
1461        
1462
1463                                                                                                                                                                                            // check for conversion from boolean to int
1464
if (criteria.containsKey(DELETED))
1465        {
1466            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1467            if (possibleBoolean instanceof Boolean JavaDoc)
1468            {
1469                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1470            }
1471         }
1472                                    // check for conversion from boolean to int
1473
if (criteria.containsKey(APPROVED))
1474        {
1475            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1476            if (possibleBoolean instanceof Boolean JavaDoc)
1477            {
1478                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1479            }
1480         }
1481                                                                        // check for conversion from boolean to int
1482
if (criteria.containsKey(HOME_PAGE))
1483        {
1484            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1485            if (possibleBoolean instanceof Boolean JavaDoc)
1486            {
1487                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1488            }
1489         }
1490                                    
1491        List JavaDoc rows = BasePeer.doSelect(criteria);
1492        List JavaDoc results = new ArrayList JavaDoc();
1493
1494        for (int i = 0; i < rows.size(); i++)
1495        {
1496            Record row = (Record) rows.get(i);
1497
1498                            Class JavaDoc omClass = QueryPeer.getOMClass();
1499                    Query obj1 = (Query) QueryPeer
1500                .row2Object(row, 1, omClass);
1501                     omClass = FrequencyPeer.getOMClass();
1502                    Frequency obj2 = (Frequency)FrequencyPeer
1503                .row2Object(row, offset, omClass);
1504
1505            boolean newObject = true;
1506            for (int j = 0; j < results.size(); j++)
1507            {
1508                Query temp_obj1 = (Query)results.get(j);
1509                Frequency temp_obj2 = (Frequency)temp_obj1.getFrequency();
1510                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1511                {
1512                    newObject = false;
1513                              temp_obj2.addQuery(obj1);
1514                              break;
1515                }
1516            }
1517                      if (newObject)
1518            {
1519                obj2.initQuerys();
1520                obj2.addQuery(obj1);
1521            }
1522                      results.add(obj1);
1523        }
1524        return results;
1525    }
1526                    
1527  
1528                                                                  
1529          
1530        
1531                                  
1532                
1533
1534    /**
1535     * selects a collection of Query objects pre-filled with
1536     * all related objects.
1537     *
1538     * This method is protected by default in order to keep the public
1539     * api reasonable. You can provide public methods for those you
1540     * actually need in QueryPeer.
1541     *
1542     * @throws TorqueException Any exceptions caught during processing will be
1543     * rethrown wrapped into a TorqueException.
1544     */

1545    protected static List JavaDoc doSelectJoinAllExceptScarabUserImpl(Criteria criteria)
1546        throws TorqueException
1547    {
1548        setDbName(criteria);
1549
1550        addSelectColumns(criteria);
1551        int offset2 = numColumns + 1;
1552                                    
1553                                                  
1554                    ScopePeer.addSelectColumns(criteria);
1555        int offset3 = offset2 + ScopePeer.numColumns;
1556                                                                
1557                    ScarabModulePeer.addSelectColumns(criteria);
1558        int offset4 = offset3 + ScarabModulePeer.numColumns;
1559                                                                
1560                    IssueTypePeer.addSelectColumns(criteria);
1561        int offset5 = offset4 + IssueTypePeer.numColumns;
1562                                                                
1563                    MITListPeer.addSelectColumns(criteria);
1564        int offset6 = offset5 + MITListPeer.numColumns;
1565                                                                
1566                    FrequencyPeer.addSelectColumns(criteria);
1567        int offset7 = offset6 + FrequencyPeer.numColumns;
1568                                                                                                                                                                                                                                        // check for conversion from boolean to int
1569
if (criteria.containsKey(DELETED))
1570        {
1571            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1572            if (possibleBoolean instanceof Boolean JavaDoc)
1573            {
1574                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1575            }
1576         }
1577                                    // check for conversion from boolean to int
1578
if (criteria.containsKey(APPROVED))
1579        {
1580            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1581            if (possibleBoolean instanceof Boolean JavaDoc)
1582            {
1583                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1584            }
1585         }
1586                                                                        // check for conversion from boolean to int
1587
if (criteria.containsKey(HOME_PAGE))
1588        {
1589            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1590            if (possibleBoolean instanceof Boolean JavaDoc)
1591            {
1592                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1593            }
1594         }
1595                                    
1596        List JavaDoc rows = BasePeer.doSelect(criteria);
1597        List JavaDoc results = new ArrayList JavaDoc();
1598
1599        for (int i = 0; i < rows.size(); i++)
1600        {
1601            Record row = (Record)rows.get(i);
1602
1603                            Class JavaDoc omClass = QueryPeer.getOMClass();
1604                    Query obj1 = (Query)QueryPeer
1605                .row2Object(row, 1, omClass);
1606                                                            
1607                                                                  
1608                                                        
1609                            
1610              
1611                           omClass = ScopePeer.getOMClass();
1612                          Scope obj2 = (Scope)ScopePeer
1613                .row2Object( row, offset2, omClass);
1614
1615               boolean newObject = true;
1616            for (int j = 0; j < results.size(); j++)
1617            {
1618                Query temp_obj1 = (Query)results.get(j);
1619                Scope temp_obj2 = (Scope)temp_obj1.getScope();
1620                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1621                {
1622                    newObject = false;
1623                                    temp_obj2.addQuery(obj1);
1624                                    break;
1625                }
1626            }
1627                            if (newObject)
1628            {
1629                obj2.initQuerys();
1630                obj2.addQuery(obj1);
1631            }
1632                                                                                                
1633                                                        
1634                            
1635              
1636                           omClass = ScarabModulePeer.getOMClass(row, offset3);
1637                          ScarabModule obj3 = (ScarabModule)ScarabModulePeer
1638                .row2Object( row, offset3, omClass);
1639
1640               newObject = true;
1641            for (int j = 0; j < results.size(); j++)
1642            {
1643                Query temp_obj1 = (Query)results.get(j);
1644                ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule();
1645                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1646                {
1647                    newObject = false;
1648                                    temp_obj3.addQuery(obj1);
1649                                    break;
1650                }
1651            }
1652                            if (newObject)
1653            {
1654                obj3.initQuerys();
1655                obj3.addQuery(obj1);
1656            }
1657                                                                                    
1658                                                        
1659                            
1660              
1661                           omClass = IssueTypePeer.getOMClass();
1662                          IssueType obj4 = (IssueType)IssueTypePeer
1663                .row2Object( row, offset4, omClass);
1664
1665               newObject = true;
1666            for (int j = 0; j < results.size(); j++)
1667            {
1668                Query temp_obj1 = (Query)results.get(j);
1669                IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType();
1670                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1671                {
1672                    newObject = false;
1673                                    temp_obj4.addQuery(obj1);
1674                                    break;
1675                }
1676            }
1677                            if (newObject)
1678            {
1679                obj4.initQuerys();
1680                obj4.addQuery(obj1);
1681            }
1682                                                                                    
1683                                                        
1684                            
1685              
1686                           omClass = MITListPeer.getOMClass();
1687                          MITList obj5 = (MITList)MITListPeer
1688                .row2Object( row, offset5, omClass);
1689
1690               newObject = true;
1691            for (int j = 0; j < results.size(); j++)
1692            {
1693                Query temp_obj1 = (Query)results.get(j);
1694                MITList temp_obj5 = (MITList)temp_obj1.getMITList();
1695                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1696                {
1697                    newObject = false;
1698                                    temp_obj5.addQuery(obj1);
1699                                    break;
1700                }
1701            }
1702                            if (newObject)
1703            {
1704                obj5.initQuerys();
1705                obj5.addQuery(obj1);
1706            }
1707                                                                                    
1708                                                        
1709                            
1710              
1711                           omClass = FrequencyPeer.getOMClass();
1712                          Frequency obj6 = (Frequency)FrequencyPeer
1713                .row2Object( row, offset6, omClass);
1714
1715               newObject = true;
1716            for (int j = 0; j < results.size(); j++)
1717            {
1718                Query temp_obj1 = (Query)results.get(j);
1719                Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency();
1720                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
1721                {
1722                    newObject = false;
1723                                    temp_obj6.addQuery(obj1);
1724                                    break;
1725                }
1726            }
1727                            if (newObject)
1728            {
1729                obj6.initQuerys();
1730                obj6.addQuery(obj1);
1731            }
1732                                                                results.add(obj1);
1733        }
1734        return results;
1735    }
1736        
1737        
1738                                  
1739                
1740
1741    /**
1742     * selects a collection of Query objects pre-filled with
1743     * all related objects.
1744     *
1745     * This method is protected by default in order to keep the public
1746     * api reasonable. You can provide public methods for those you
1747     * actually need in QueryPeer.
1748     *
1749     * @throws TorqueException Any exceptions caught during processing will be
1750     * rethrown wrapped into a TorqueException.
1751     */

1752    protected static List JavaDoc doSelectJoinAllExceptScope(Criteria criteria)
1753        throws TorqueException
1754    {
1755        setDbName(criteria);
1756
1757        addSelectColumns(criteria);
1758        int offset2 = numColumns + 1;
1759                                    
1760                    ScarabUserImplPeer.addSelectColumns(criteria);
1761        int offset3 = offset2 + ScarabUserImplPeer.numColumns;
1762                                                                
1763                                                  
1764                    ScarabModulePeer.addSelectColumns(criteria);
1765        int offset4 = offset3 + ScarabModulePeer.numColumns;
1766                                                                
1767                    IssueTypePeer.addSelectColumns(criteria);
1768        int offset5 = offset4 + IssueTypePeer.numColumns;
1769                                                                
1770                    MITListPeer.addSelectColumns(criteria);
1771        int offset6 = offset5 + MITListPeer.numColumns;
1772                                                                
1773                    FrequencyPeer.addSelectColumns(criteria);
1774        int offset7 = offset6 + FrequencyPeer.numColumns;
1775                                                                                                                                                                                                                                        // check for conversion from boolean to int
1776
if (criteria.containsKey(DELETED))
1777        {
1778            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1779            if (possibleBoolean instanceof Boolean JavaDoc)
1780            {
1781                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1782            }
1783         }
1784                                    // check for conversion from boolean to int
1785
if (criteria.containsKey(APPROVED))
1786        {
1787            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1788            if (possibleBoolean instanceof Boolean JavaDoc)
1789            {
1790                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1791            }
1792         }
1793                                                                        // check for conversion from boolean to int
1794
if (criteria.containsKey(HOME_PAGE))
1795        {
1796            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
1797            if (possibleBoolean instanceof Boolean JavaDoc)
1798            {
1799                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1800            }
1801         }
1802                                    
1803        List JavaDoc rows = BasePeer.doSelect(criteria);
1804        List JavaDoc results = new ArrayList JavaDoc();
1805
1806        for (int i = 0; i < rows.size(); i++)
1807        {
1808            Record row = (Record)rows.get(i);
1809
1810                            Class JavaDoc omClass = QueryPeer.getOMClass();
1811                    Query obj1 = (Query)QueryPeer
1812                .row2Object(row, 1, omClass);
1813                                                            
1814                                                        
1815                            
1816              
1817                           omClass = ScarabUserImplPeer.getOMClass();
1818                          ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
1819                .row2Object( row, offset2, omClass);
1820
1821               boolean newObject = true;
1822            for (int j = 0; j < results.size(); j++)
1823            {
1824                Query temp_obj1 = (Query)results.get(j);
1825                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser();
1826                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1827                {
1828                    newObject = false;
1829                                    temp_obj2.addQuery(obj1);
1830                                    break;
1831                }
1832            }
1833                            if (newObject)
1834            {
1835                obj2.initQuerys();
1836                obj2.addQuery(obj1);
1837            }
1838                                                                                    
1839                                                                              
1840                                                        
1841                            
1842              
1843                           omClass = ScarabModulePeer.getOMClass(row, offset3);
1844                          ScarabModule obj3 = (ScarabModule)ScarabModulePeer
1845                .row2Object( row, offset3, omClass);
1846
1847               newObject = true;
1848            for (int j = 0; j < results.size(); j++)
1849            {
1850                Query temp_obj1 = (Query)results.get(j);
1851                ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule();
1852                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1853                {
1854                    newObject = false;
1855                                    temp_obj3.addQuery(obj1);
1856                                    break;
1857                }
1858            }
1859                            if (newObject)
1860            {
1861                obj3.initQuerys();
1862                obj3.addQuery(obj1);
1863            }
1864                                                                                    
1865                                                        
1866                            
1867              
1868                           omClass = IssueTypePeer.getOMClass();
1869                          IssueType obj4 = (IssueType)IssueTypePeer
1870                .row2Object( row, offset4, omClass);
1871
1872               newObject = true;
1873            for (int j = 0; j < results.size(); j++)
1874            {
1875                Query temp_obj1 = (Query)results.get(j);
1876                IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType();
1877                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1878                {
1879                    newObject = false;
1880                                    temp_obj4.addQuery(obj1);
1881                                    break;
1882                }
1883            }
1884                            if (newObject)
1885            {
1886                obj4.initQuerys();
1887                obj4.addQuery(obj1);
1888            }
1889                                                                                    
1890                                                        
1891                            
1892              
1893                           omClass = MITListPeer.getOMClass();
1894                          MITList obj5 = (MITList)MITListPeer
1895                .row2Object( row, offset5, omClass);
1896
1897               newObject = true;
1898            for (int j = 0; j < results.size(); j++)
1899            {
1900                Query temp_obj1 = (Query)results.get(j);
1901                MITList temp_obj5 = (MITList)temp_obj1.getMITList();
1902                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1903                {
1904                    newObject = false;
1905                                    temp_obj5.addQuery(obj1);
1906                                    break;
1907                }
1908            }
1909                            if (newObject)
1910            {
1911                obj5.initQuerys();
1912                obj5.addQuery(obj1);
1913            }
1914                                                                                    
1915                                                        
1916                            
1917              
1918                           omClass = FrequencyPeer.getOMClass();
1919                          Frequency obj6 = (Frequency)FrequencyPeer
1920                .row2Object( row, offset6, omClass);
1921
1922               newObject = true;
1923            for (int j = 0; j < results.size(); j++)
1924            {
1925                Query temp_obj1 = (Query)results.get(j);
1926                Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency();
1927                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
1928                {
1929                    newObject = false;
1930                                    temp_obj6.addQuery(obj1);
1931                                    break;
1932                }
1933            }
1934                            if (newObject)
1935            {
1936                obj6.initQuerys();
1937                obj6.addQuery(obj1);
1938            }
1939                                                                results.add(obj1);
1940        }
1941        return results;
1942    }
1943        
1944        
1945                                  
1946                
1947
1948    /**
1949     * selects a collection of Query objects pre-filled with
1950     * all related objects.
1951     *
1952     * This method is protected by default in order to keep the public
1953     * api reasonable. You can provide public methods for those you
1954     * actually need in QueryPeer.
1955     *
1956     * @throws TorqueException Any exceptions caught during processing will be
1957     * rethrown wrapped into a TorqueException.
1958     */

1959    protected static List JavaDoc doSelectJoinAllExceptScarabModule(Criteria criteria)
1960        throws TorqueException
1961    {
1962        setDbName(criteria);
1963
1964        addSelectColumns(criteria);
1965        int offset2 = numColumns + 1;
1966                                    
1967                    ScarabUserImplPeer.addSelectColumns(criteria);
1968        int offset3 = offset2 + ScarabUserImplPeer.numColumns;
1969                                                                
1970                    ScopePeer.addSelectColumns(criteria);
1971        int offset4 = offset3 + ScopePeer.numColumns;
1972                                                                
1973                                                  
1974                    IssueTypePeer.addSelectColumns(criteria);
1975        int offset5 = offset4 + IssueTypePeer.numColumns;
1976                                                                
1977                    MITListPeer.addSelectColumns(criteria);
1978        int offset6 = offset5 + MITListPeer.numColumns;
1979                                                                
1980                    FrequencyPeer.addSelectColumns(criteria);
1981        int offset7 = offset6 + FrequencyPeer.numColumns;
1982                                                                                                                                                                                                                                        // check for conversion from boolean to int
1983
if (criteria.containsKey(DELETED))
1984        {
1985            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1986            if (possibleBoolean instanceof Boolean JavaDoc)
1987            {
1988                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1989            }
1990         }
1991                                    // check for conversion from boolean to int
1992
if (criteria.containsKey(APPROVED))
1993        {
1994            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
1995            if (possibleBoolean instanceof Boolean JavaDoc)
1996            {
1997                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1998            }
1999         }
2000                                                                        // check for conversion from boolean to int
2001
if (criteria.containsKey(HOME_PAGE))
2002        {
2003            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
2004            if (possibleBoolean instanceof Boolean JavaDoc)
2005            {
2006                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2007            }
2008         }
2009                                    
2010        List JavaDoc rows = BasePeer.doSelect(criteria);
2011        List JavaDoc results = new ArrayList JavaDoc();
2012
2013        for (int i = 0; i < rows.size(); i++)
2014        {
2015            Record row = (Record)rows.get(i);
2016
2017                            Class JavaDoc omClass = QueryPeer.getOMClass();
2018                    Query obj1 = (Query)QueryPeer
2019                .row2Object(row, 1, omClass);
2020                                                            
2021                                                        
2022                            
2023              
2024                           omClass = ScarabUserImplPeer.getOMClass();
2025                          ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
2026                .row2Object( row, offset2, omClass);
2027
2028               boolean newObject = true;
2029            for (int j = 0; j < results.size(); j++)
2030            {
2031                Query temp_obj1 = (Query)results.get(j);
2032                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser();
2033                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2034                {
2035                    newObject = false;
2036                                    temp_obj2.addQuery(obj1);
2037                                    break;
2038                }
2039            }
2040                            if (newObject)
2041            {
2042                obj2.initQuerys();
2043                obj2.addQuery(obj1);
2044            }
2045                                                                                    
2046                                                        
2047                            
2048              
2049                           omClass = ScopePeer.getOMClass();
2050                          Scope obj3 = (Scope)ScopePeer
2051                .row2Object( row, offset3, omClass);
2052
2053               newObject = true;
2054            for (int j = 0; j < results.size(); j++)
2055            {
2056                Query temp_obj1 = (Query)results.get(j);
2057                Scope temp_obj3 = (Scope)temp_obj1.getScope();
2058                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2059                {
2060                    newObject = false;
2061                                    temp_obj3.addQuery(obj1);
2062                                    break;
2063                }
2064            }
2065                            if (newObject)
2066            {
2067                obj3.initQuerys();
2068                obj3.addQuery(obj1);
2069            }
2070                                                                                                
2071                                                                  
2072                                                        
2073                            
2074              
2075                           omClass = IssueTypePeer.getOMClass();
2076                          IssueType obj4 = (IssueType)IssueTypePeer
2077                .row2Object( row, offset4, omClass);
2078
2079               newObject = true;
2080            for (int j = 0; j < results.size(); j++)
2081            {
2082                Query temp_obj1 = (Query)results.get(j);
2083                IssueType temp_obj4 = (IssueType)temp_obj1.getIssueType();
2084                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2085                {
2086                    newObject = false;
2087                                    temp_obj4.addQuery(obj1);
2088                                    break;
2089                }
2090            }
2091                            if (newObject)
2092            {
2093                obj4.initQuerys();
2094                obj4.addQuery(obj1);
2095            }
2096                                                                                    
2097                                                        
2098                            
2099              
2100                           omClass = MITListPeer.getOMClass();
2101                          MITList obj5 = (MITList)MITListPeer
2102                .row2Object( row, offset5, omClass);
2103
2104               newObject = true;
2105            for (int j = 0; j < results.size(); j++)
2106            {
2107                Query temp_obj1 = (Query)results.get(j);
2108                MITList temp_obj5 = (MITList)temp_obj1.getMITList();
2109                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2110                {
2111                    newObject = false;
2112                                    temp_obj5.addQuery(obj1);
2113                                    break;
2114                }
2115            }
2116                            if (newObject)
2117            {
2118                obj5.initQuerys();
2119                obj5.addQuery(obj1);
2120            }
2121                                                                                    
2122                                                        
2123                            
2124              
2125                           omClass = FrequencyPeer.getOMClass();
2126                          Frequency obj6 = (Frequency)FrequencyPeer
2127                .row2Object( row, offset6, omClass);
2128
2129               newObject = true;
2130            for (int j = 0; j < results.size(); j++)
2131            {
2132                Query temp_obj1 = (Query)results.get(j);
2133                Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency();
2134                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2135                {
2136                    newObject = false;
2137                                    temp_obj6.addQuery(obj1);
2138                                    break;
2139                }
2140            }
2141                            if (newObject)
2142            {
2143                obj6.initQuerys();
2144                obj6.addQuery(obj1);
2145            }
2146                                                                results.add(obj1);
2147        }
2148        return results;
2149    }
2150        
2151        
2152                                  
2153                
2154
2155    /**
2156     * selects a collection of Query objects pre-filled with
2157     * all related objects.
2158     *
2159     * This method is protected by default in order to keep the public
2160     * api reasonable. You can provide public methods for those you
2161     * actually need in QueryPeer.
2162     *
2163     * @throws TorqueException Any exceptions caught during processing will be
2164     * rethrown wrapped into a TorqueException.
2165     */

2166    protected static List JavaDoc doSelectJoinAllExceptIssueType(Criteria criteria)
2167        throws TorqueException
2168    {
2169        setDbName(criteria);
2170
2171        addSelectColumns(criteria);
2172        int offset2 = numColumns + 1;
2173                                    
2174                    ScarabUserImplPeer.addSelectColumns(criteria);
2175        int offset3 = offset2 + ScarabUserImplPeer.numColumns;
2176                                                                
2177                    ScopePeer.addSelectColumns(criteria);
2178        int offset4 = offset3 + ScopePeer.numColumns;
2179                                                                
2180                    ScarabModulePeer.addSelectColumns(criteria);
2181        int offset5 = offset4 + ScarabModulePeer.numColumns;
2182                                                                
2183                                                  
2184                    MITListPeer.addSelectColumns(criteria);
2185        int offset6 = offset5 + MITListPeer.numColumns;
2186                                                                
2187                    FrequencyPeer.addSelectColumns(criteria);
2188        int offset7 = offset6 + FrequencyPeer.numColumns;
2189                                                                                                                                                                                                                                        // check for conversion from boolean to int
2190
if (criteria.containsKey(DELETED))
2191        {
2192            Object JavaDoc possibleBoolean = criteria.get(DELETED);
2193            if (possibleBoolean instanceof Boolean JavaDoc)
2194            {
2195                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2196            }
2197         }
2198                                    // check for conversion from boolean to int
2199
if (criteria.containsKey(APPROVED))
2200        {
2201            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
2202            if (possibleBoolean instanceof Boolean JavaDoc)
2203            {
2204                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2205            }
2206         }
2207                                                                        // check for conversion from boolean to int
2208
if (criteria.containsKey(HOME_PAGE))
2209        {
2210            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
2211            if (possibleBoolean instanceof Boolean JavaDoc)
2212            {
2213                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2214            }
2215         }
2216                                    
2217        List JavaDoc rows = BasePeer.doSelect(criteria);
2218        List JavaDoc results = new ArrayList JavaDoc();
2219
2220        for (int i = 0; i < rows.size(); i++)
2221        {
2222            Record row = (Record)rows.get(i);
2223
2224                            Class JavaDoc omClass = QueryPeer.getOMClass();
2225                    Query obj1 = (Query)QueryPeer
2226                .row2Object(row, 1, omClass);
2227                                                            
2228                                                        
2229                            
2230              
2231                           omClass = ScarabUserImplPeer.getOMClass();
2232                          ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
2233                .row2Object( row, offset2, omClass);
2234
2235               boolean newObject = true;
2236            for (int j = 0; j < results.size(); j++)
2237            {
2238                Query temp_obj1 = (Query)results.get(j);
2239                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser();
2240                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2241                {
2242                    newObject = false;
2243                                    temp_obj2.addQuery(obj1);
2244                                    break;
2245                }
2246            }
2247                            if (newObject)
2248            {
2249                obj2.initQuerys();
2250                obj2.addQuery(obj1);
2251            }
2252                                                                                    
2253                                                        
2254                            
2255              
2256                           omClass = ScopePeer.getOMClass();
2257                          Scope obj3 = (Scope)ScopePeer
2258                .row2Object( row, offset3, omClass);
2259
2260               newObject = true;
2261            for (int j = 0; j < results.size(); j++)
2262            {
2263                Query temp_obj1 = (Query)results.get(j);
2264                Scope temp_obj3 = (Scope)temp_obj1.getScope();
2265                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2266                {
2267                    newObject = false;
2268                                    temp_obj3.addQuery(obj1);
2269                                    break;
2270                }
2271            }
2272                            if (newObject)
2273            {
2274                obj3.initQuerys();
2275                obj3.addQuery(obj1);
2276            }
2277                                                                                                
2278                                                        
2279                            
2280              
2281                           omClass = ScarabModulePeer.getOMClass(row, offset4);
2282                          ScarabModule obj4 = (ScarabModule)ScarabModulePeer
2283                .row2Object( row, offset4, omClass);
2284
2285               newObject = true;
2286            for (int j = 0; j < results.size(); j++)
2287            {
2288                Query temp_obj1 = (Query)results.get(j);
2289                ScarabModule temp_obj4 = (ScarabModule)temp_obj1.getModule();
2290                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2291                {
2292                    newObject = false;
2293                                    temp_obj4.addQuery(obj1);
2294                                    break;
2295                }
2296            }
2297                            if (newObject)
2298            {
2299                obj4.initQuerys();
2300                obj4.addQuery(obj1);
2301            }
2302                                                                                    
2303                                                                  
2304                                                        
2305                            
2306              
2307                           omClass = MITListPeer.getOMClass();
2308                          MITList obj5 = (MITList)MITListPeer
2309                .row2Object( row, offset5, omClass);
2310
2311               newObject = true;
2312            for (int j = 0; j < results.size(); j++)
2313            {
2314                Query temp_obj1 = (Query)results.get(j);
2315                MITList temp_obj5 = (MITList)temp_obj1.getMITList();
2316                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2317                {
2318                    newObject = false;
2319                                    temp_obj5.addQuery(obj1);
2320                                    break;
2321                }
2322            }
2323                            if (newObject)
2324            {
2325                obj5.initQuerys();
2326                obj5.addQuery(obj1);
2327            }
2328                                                                                    
2329                                                        
2330                            
2331              
2332                           omClass = FrequencyPeer.getOMClass();
2333                          Frequency obj6 = (Frequency)FrequencyPeer
2334                .row2Object( row, offset6, omClass);
2335
2336               newObject = true;
2337            for (int j = 0; j < results.size(); j++)
2338            {
2339                Query temp_obj1 = (Query)results.get(j);
2340                Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency();
2341                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2342                {
2343                    newObject = false;
2344                                    temp_obj6.addQuery(obj1);
2345                                    break;
2346                }
2347            }
2348                            if (newObject)
2349            {
2350                obj6.initQuerys();
2351                obj6.addQuery(obj1);
2352            }
2353                                                                results.add(obj1);
2354        }
2355        return results;
2356    }
2357        
2358        
2359                                  
2360                
2361
2362    /**
2363     * selects a collection of Query objects pre-filled with
2364     * all related objects.
2365     *
2366     * This method is protected by default in order to keep the public
2367     * api reasonable. You can provide public methods for those you
2368     * actually need in QueryPeer.
2369     *
2370     * @throws TorqueException Any exceptions caught during processing will be
2371     * rethrown wrapped into a TorqueException.
2372     */

2373    protected static List JavaDoc doSelectJoinAllExceptMITList(Criteria criteria)
2374        throws TorqueException
2375    {
2376        setDbName(criteria);
2377
2378        addSelectColumns(criteria);
2379        int offset2 = numColumns + 1;
2380                                    
2381                    ScarabUserImplPeer.addSelectColumns(criteria);
2382        int offset3 = offset2 + ScarabUserImplPeer.numColumns;
2383                                                                
2384                    ScopePeer.addSelectColumns(criteria);
2385        int offset4 = offset3 + ScopePeer.numColumns;
2386                                                                
2387                    ScarabModulePeer.addSelectColumns(criteria);
2388        int offset5 = offset4 + ScarabModulePeer.numColumns;
2389                                                                
2390                    IssueTypePeer.addSelectColumns(criteria);
2391        int offset6 = offset5 + IssueTypePeer.numColumns;
2392                                                                
2393                                                  
2394                    FrequencyPeer.addSelectColumns(criteria);
2395        int offset7 = offset6 + FrequencyPeer.numColumns;
2396                                                                                                                                                                                                                                        // check for conversion from boolean to int
2397
if (criteria.containsKey(DELETED))
2398        {
2399            Object JavaDoc possibleBoolean = criteria.get(DELETED);
2400            if (possibleBoolean instanceof Boolean JavaDoc)
2401            {
2402                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2403            }
2404         }
2405                                    // check for conversion from boolean to int
2406
if (criteria.containsKey(APPROVED))
2407        {
2408            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
2409            if (possibleBoolean instanceof Boolean JavaDoc)
2410            {
2411                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2412            }
2413         }
2414                                                                        // check for conversion from boolean to int
2415
if (criteria.containsKey(HOME_PAGE))
2416        {
2417            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
2418            if (possibleBoolean instanceof Boolean JavaDoc)
2419            {
2420                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2421            }
2422         }
2423                                    
2424        List JavaDoc rows = BasePeer.doSelect(criteria);
2425        List JavaDoc results = new ArrayList JavaDoc();
2426
2427        for (int i = 0; i < rows.size(); i++)
2428        {
2429            Record row = (Record)rows.get(i);
2430
2431                            Class JavaDoc omClass = QueryPeer.getOMClass();
2432                    Query obj1 = (Query)QueryPeer
2433                .row2Object(row, 1, omClass);
2434                                                            
2435                                                        
2436                            
2437              
2438                           omClass = ScarabUserImplPeer.getOMClass();
2439                          ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
2440                .row2Object( row, offset2, omClass);
2441
2442               boolean newObject = true;
2443            for (int j = 0; j < results.size(); j++)
2444            {
2445                Query temp_obj1 = (Query)results.get(j);
2446                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser();
2447                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2448                {
2449                    newObject = false;
2450                                    temp_obj2.addQuery(obj1);
2451                                    break;
2452                }
2453            }
2454                            if (newObject)
2455            {
2456                obj2.initQuerys();
2457                obj2.addQuery(obj1);
2458            }
2459                                                                                    
2460                                                        
2461                            
2462              
2463                           omClass = ScopePeer.getOMClass();
2464                          Scope obj3 = (Scope)ScopePeer
2465                .row2Object( row, offset3, omClass);
2466
2467               newObject = true;
2468            for (int j = 0; j < results.size(); j++)
2469            {
2470                Query temp_obj1 = (Query)results.get(j);
2471                Scope temp_obj3 = (Scope)temp_obj1.getScope();
2472                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2473                {
2474                    newObject = false;
2475                                    temp_obj3.addQuery(obj1);
2476                                    break;
2477                }
2478            }
2479                            if (newObject)
2480            {
2481                obj3.initQuerys();
2482                obj3.addQuery(obj1);
2483            }
2484                                                                                                
2485                                                        
2486                            
2487              
2488                           omClass = ScarabModulePeer.getOMClass(row, offset4);
2489                          ScarabModule obj4 = (ScarabModule)ScarabModulePeer
2490                .row2Object( row, offset4, omClass);
2491
2492               newObject = true;
2493            for (int j = 0; j < results.size(); j++)
2494            {
2495                Query temp_obj1 = (Query)results.get(j);
2496                ScarabModule temp_obj4 = (ScarabModule)temp_obj1.getModule();
2497                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2498                {
2499                    newObject = false;
2500                                    temp_obj4.addQuery(obj1);
2501                                    break;
2502                }
2503            }
2504                            if (newObject)
2505            {
2506                obj4.initQuerys();
2507                obj4.addQuery(obj1);
2508            }
2509                                                                                    
2510                                                        
2511                            
2512              
2513                           omClass = IssueTypePeer.getOMClass();
2514                          IssueType obj5 = (IssueType)IssueTypePeer
2515                .row2Object( row, offset5, omClass);
2516
2517               newObject = true;
2518            for (int j = 0; j < results.size(); j++)
2519            {
2520                Query temp_obj1 = (Query)results.get(j);
2521                IssueType temp_obj5 = (IssueType)temp_obj1.getIssueType();
2522                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2523                {
2524                    newObject = false;
2525                                    temp_obj5.addQuery(obj1);
2526                                    break;
2527                }
2528            }
2529                            if (newObject)
2530            {
2531                obj5.initQuerys();
2532                obj5.addQuery(obj1);
2533            }
2534                                                                                    
2535                                                                  
2536                                                        
2537                            
2538              
2539                           omClass = FrequencyPeer.getOMClass();
2540                          Frequency obj6 = (Frequency)FrequencyPeer
2541                .row2Object( row, offset6, omClass);
2542
2543               newObject = true;
2544            for (int j = 0; j < results.size(); j++)
2545            {
2546                Query temp_obj1 = (Query)results.get(j);
2547                Frequency temp_obj6 = (Frequency)temp_obj1.getFrequency();
2548                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2549                {
2550                    newObject = false;
2551                                    temp_obj6.addQuery(obj1);
2552                                    break;
2553                }
2554            }
2555                            if (newObject)
2556            {
2557                obj6.initQuerys();
2558                obj6.addQuery(obj1);
2559            }
2560                                                                results.add(obj1);
2561        }
2562        return results;
2563    }
2564        
2565        
2566                                  
2567                
2568
2569    /**
2570     * selects a collection of Query objects pre-filled with
2571     * all related objects.
2572     *
2573     * This method is protected by default in order to keep the public
2574     * api reasonable. You can provide public methods for those you
2575     * actually need in QueryPeer.
2576     *
2577     * @throws TorqueException Any exceptions caught during processing will be
2578     * rethrown wrapped into a TorqueException.
2579     */

2580    protected static List JavaDoc doSelectJoinAllExceptFrequency(Criteria criteria)
2581        throws TorqueException
2582    {
2583        setDbName(criteria);
2584
2585        addSelectColumns(criteria);
2586        int offset2 = numColumns + 1;
2587                                    
2588                    ScarabUserImplPeer.addSelectColumns(criteria);
2589        int offset3 = offset2 + ScarabUserImplPeer.numColumns;
2590                                                                
2591                    ScopePeer.addSelectColumns(criteria);
2592        int offset4 = offset3 + ScopePeer.numColumns;
2593                                                                
2594                    ScarabModulePeer.addSelectColumns(criteria);
2595        int offset5 = offset4 + ScarabModulePeer.numColumns;
2596                                                                
2597                    IssueTypePeer.addSelectColumns(criteria);
2598        int offset6 = offset5 + IssueTypePeer.numColumns;
2599                                                                
2600                    MITListPeer.addSelectColumns(criteria);
2601        int offset7 = offset6 + MITListPeer.numColumns;
2602                                                                
2603                                                                                                                                                                                                                          // check for conversion from boolean to int
2604
if (criteria.containsKey(DELETED))
2605        {
2606            Object JavaDoc possibleBoolean = criteria.get(DELETED);
2607            if (possibleBoolean instanceof Boolean JavaDoc)
2608            {
2609                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2610            }
2611         }
2612                                    // check for conversion from boolean to int
2613
if (criteria.containsKey(APPROVED))
2614        {
2615            Object JavaDoc possibleBoolean = criteria.get(APPROVED);
2616            if (possibleBoolean instanceof Boolean JavaDoc)
2617            {
2618                criteria.add(APPROVED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2619            }
2620         }
2621                                                                        // check for conversion from boolean to int
2622
if (criteria.containsKey(HOME_PAGE))
2623        {
2624            Object JavaDoc possibleBoolean = criteria.get(HOME_PAGE);
2625            if (possibleBoolean instanceof Boolean JavaDoc)
2626            {
2627                criteria.add(HOME_PAGE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
2628            }
2629         }
2630                                    
2631        List JavaDoc rows = BasePeer.doSelect(criteria);
2632        List JavaDoc results = new ArrayList JavaDoc();
2633
2634        for (int i = 0; i < rows.size(); i++)
2635        {
2636            Record row = (Record)rows.get(i);
2637
2638                            Class JavaDoc omClass = QueryPeer.getOMClass();
2639                    Query obj1 = (Query)QueryPeer
2640                .row2Object(row, 1, omClass);
2641                                                            
2642                                                        
2643                            
2644              
2645                           omClass = ScarabUserImplPeer.getOMClass();
2646                          ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
2647                .row2Object( row, offset2, omClass);
2648
2649               boolean newObject = true;
2650            for (int j = 0; j < results.size(); j++)
2651            {
2652                Query temp_obj1 = (Query)results.get(j);
2653                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUser();
2654                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2655                {
2656                    newObject = false;
2657                                    temp_obj2.addQuery(obj1);
2658                                    break;
2659                }
2660            }
2661                            if (newObject)
2662            {
2663                obj2.initQuerys();
2664                obj2.addQuery(obj1);
2665            }
2666                                                                                    
2667                                                        
2668                            
2669              
2670                           omClass = ScopePeer.getOMClass();
2671                          Scope obj3 = (Scope)ScopePeer
2672                .row2Object( row, offset3, omClass);
2673
2674               newObject = true;
2675            for (int j = 0; j < results.size(); j++)
2676            {
2677                Query temp_obj1 = (Query)results.get(j);
2678                Scope temp_obj3 = (Scope)temp_obj1.getScope();
2679                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2680                {
2681                    newObject = false;
2682                                    temp_obj3.addQuery(obj1);
2683                                    break;
2684                }
2685            }
2686                            if (newObject)
2687            {
2688                obj3.initQuerys();
2689                obj3.addQuery(obj1);
2690            }
2691                                                                                                
2692                                                        
2693                            
2694              
2695                           omClass = ScarabModulePeer.getOMClass(row, offset4);
2696                          ScarabModule obj4 = (ScarabModule)ScarabModulePeer
2697                .row2Object( row, offset4, omClass);
2698
2699               newObject = true;
2700            for (int j = 0; j < results.size(); j++)
2701            {
2702                Query temp_obj1 = (Query)results.get(j);
2703                ScarabModule temp_obj4 = (ScarabModule)temp_obj1.getModule();
2704                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2705                {
2706                    newObject = false;
2707                                    temp_obj4.addQuery(obj1);
2708                                    break;
2709                }
2710            }
2711                            if (newObject)
2712            {
2713                obj4.initQuerys();
2714                obj4.addQuery(obj1);
2715            }
2716                                                                                    
2717                                                        
2718                            
2719              
2720                           omClass = IssueTypePeer.getOMClass();
2721                          IssueType obj5 = (IssueType)IssueTypePeer
2722                .row2Object( row, offset5, omClass);
2723
2724               newObject = true;
2725            for (int j = 0; j < results.size(); j++)
2726            {
2727                Query temp_obj1 = (Query)results.get(j);
2728                IssueType temp_obj5 = (IssueType)temp_obj1.getIssueType();
2729                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2730                {
2731                    newObject = false;
2732                                    temp_obj5.addQuery(obj1);
2733                                    break;
2734                }
2735            }
2736                            if (newObject)
2737            {
2738                obj5.initQuerys();
2739                obj5.addQuery(obj1);
2740            }
2741                                                                                    
2742                                                        
2743                            
2744              
2745                           omClass = MITListPeer.getOMClass();
2746                          MITList obj6 = (MITList)MITListPeer
2747                .row2Object( row, offset6, omClass);
2748
2749               newObject = true;
2750            for (int j = 0; j < results.size(); j++)
2751            {
2752                Query temp_obj1 = (Query)results.get(j);
2753                MITList temp_obj6 = (MITList)temp_obj1.getMITList();
2754                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2755                {
2756                    newObject = false;
2757                                    temp_obj6.addQuery(obj1);
2758                                    break;
2759                }
2760            }
2761                            if (newObject)
2762            {
2763                obj6.initQuerys();
2764                obj6.addQuery(obj1);
2765            }
2766                                                                                    
2767                                              results.add(obj1);
2768        }
2769        return results;
2770    }
2771                    
2772  
2773      /**
2774     * Returns the TableMap related to this peer. This method is not
2775     * needed for general use but a specific application could have a need.
2776     *
2777     * @throws TorqueException Any exceptions caught during processing will be
2778     * rethrown wrapped into a TorqueException.
2779     */

2780    protected static TableMap getTableMap()
2781        throws TorqueException
2782    {
2783        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
2784    }
2785   
2786    private static void setDbName(Criteria crit)
2787    {
2788        // Set the correct dbName if it has not been overridden
2789
// crit.getDbName will return the same object if not set to
2790
// another value so == check is okay and faster
2791
if (crit.getDbName() == Torque.getDefaultDB())
2792        {
2793            crit.setDbName(DATABASE_NAME);
2794        }
2795    }
2796}
2797
Popular Tags