KickJava   Java API By Example, From Geeks To Geeks.

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


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

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

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

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

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

209     public static ObjectKey doInsert(Criteria criteria, Connection JavaDoc con)
210         throws TorqueException
211     {
212                                       // check for conversion from boolean to int
213
if (criteria.containsKey(ACTIVE))
214         {
215             Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
216             if (possibleBoolean instanceof Boolean JavaDoc)
217             {
218                 criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
219             }
220          }
221                   
222         setDbName(criteria);
223
224         if (con == null)
225         {
226             return BasePeer.doInsert(criteria);
227         }
228         else
229         {
230             return BasePeer.doInsert(criteria, con);
231         }
232     }
233
234     /**
235      * Add all the columns needed to create a new object.
236      *
237      * @param criteria object containing the columns to add.
238      * @throws TorqueException Any exceptions caught during processing will be
239      * rethrown wrapped into a TorqueException.
240      */

241     public static void addSelectColumns(Criteria criteria)
242             throws TorqueException
243     {
244           criteria.addSelectColumn(MODULE_ID);
245           criteria.addSelectColumn(ISSUE_TYPE_ID);
246           criteria.addSelectColumn(OPTION_ID);
247           criteria.addSelectColumn(DISPLAY_VALUE);
248           criteria.addSelectColumn(ACTIVE);
249           criteria.addSelectColumn(PREFERRED_ORDER);
250           criteria.addSelectColumn(WEIGHT);
251       }
252
253     /**
254      * Create a new object of type cls from a resultset row starting
255      * from a specified offset. This is done so that you can select
256      * other rows than just those needed for this object. You may
257      * for example want to create two objects from the same row.
258      *
259      * @throws TorqueException Any exceptions caught during processing will be
260      * rethrown wrapped into a TorqueException.
261      */

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

295     public static void populateObject(Record row,
296                                       int offset,
297                                       RModuleOption obj)
298         throws TorqueException
299     {
300         try
301         {
302                 obj.setModuleId(row.getValue(offset + 0).asIntegerObj());
303                   obj.setIssueTypeId(row.getValue(offset + 1).asIntegerObj());
304                   obj.setOptionId(row.getValue(offset + 2).asIntegerObj());
305                   obj.setDisplayValue(row.getValue(offset + 3).asString());
306                   obj.setActive(row.getValue(offset + 4).asBoolean());
307                   obj.setOrder(row.getValue(offset + 5).asInt());
308                   obj.setWeight(row.getValue(offset + 6).asInt());
309               }
310         catch (DataSetException e)
311         {
312             throw new TorqueException(e);
313         }
314     }
315
316     /**
317      * Method to do selects.
318      *
319      * @param criteria object used to create the SELECT statement.
320      * @return List of selected Objects
321      * @throws TorqueException Any exceptions caught during processing will be
322      * rethrown wrapped into a TorqueException.
323      */

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

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

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

370     public static List JavaDoc doSelectVillageRecords(Criteria criteria, Connection JavaDoc con)
371         throws TorqueException
372     {
373         if (criteria.getSelectColumns().size() == 0)
374         {
375             addSelectColumns(criteria);
376         }
377
378                                       // check for conversion from boolean to int
379
if (criteria.containsKey(ACTIVE))
380         {
381             Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
382             if (possibleBoolean instanceof Boolean JavaDoc)
383             {
384                 criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
385             }
386          }
387                   
388         setDbName(criteria);
389
390         // BasePeer returns a List of Value (Village) arrays. The array
391
// order follows the order columns were placed in the Select clause.
392
if (con == null)
393         {
394             return BasePeer.doSelect(criteria);
395         }
396         else
397         {
398             return BasePeer.doSelect(criteria, con);
399         }
400     }
401
402     /**
403      * The returned List will contain objects of the default type or
404      * objects that inherit from the default.
405      *
406      * @throws TorqueException Any exceptions caught during processing will be
407      * rethrown wrapped into a TorqueException.
408      */

409     public static List JavaDoc populateObjects(List JavaDoc records)
410         throws TorqueException
411     {
412         List JavaDoc results = new ArrayList JavaDoc(records.size());
413
414         // populate the object(s)
415
for (int i = 0; i < records.size(); i++)
416         {
417             Record row = (Record) records.get(i);
418               results.add(RModuleOptionPeer.row2Object(row, 1,
419                 RModuleOptionPeer.getOMClass()));
420           }
421         return results;
422     }
423  
424
425     /**
426      * The class that the Peer will make instances of.
427      * If the BO is abstract then you must implement this method
428      * in the BO.
429      *
430      * @throws TorqueException Any exceptions caught during processing will be
431      * rethrown wrapped into a TorqueException.
432      */

433     public static Class JavaDoc getOMClass()
434         throws TorqueException
435     {
436         return CLASS_DEFAULT;
437     }
438
439     /**
440      * Method to do updates.
441      *
442      * @param criteria object containing data that is used to create the UPDATE
443      * statement.
444      * @throws TorqueException Any exceptions caught during processing will be
445      * rethrown wrapped into a TorqueException.
446      */

447     public static void doUpdate(Criteria criteria) throws TorqueException
448     {
449          BaseRModuleOptionPeer
450             .doUpdate(criteria, (Connection JavaDoc) null);
451     }
452
453     /**
454      * Method to do updates. This method is to be used during a transaction,
455      * otherwise use the doUpdate(Criteria) method. It will take care of
456      * the connection details internally.
457      *
458      * @param criteria object containing data that is used to create the UPDATE
459      * statement.
460      * @param con the connection to use
461      * @throws TorqueException Any exceptions caught during processing will be
462      * rethrown wrapped into a TorqueException.
463      */

464     public static void doUpdate(Criteria criteria, Connection JavaDoc con)
465         throws TorqueException
466     {
467         Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
468                    selectCriteria.put(MODULE_ID, criteria.remove(MODULE_ID));
469                        selectCriteria.put(ISSUE_TYPE_ID, criteria.remove(ISSUE_TYPE_ID));
470                        selectCriteria.put(OPTION_ID, criteria.remove(OPTION_ID));
471                             // check for conversion from boolean to int
472
if (criteria.containsKey(ACTIVE))
473         {
474             Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
475             if (possibleBoolean instanceof Boolean JavaDoc)
476             {
477                 criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
478             }
479          }
480                               
481         setDbName(criteria);
482
483         if (con == null)
484         {
485             BasePeer.doUpdate(selectCriteria, criteria);
486         }
487         else
488         {
489             BasePeer.doUpdate(selectCriteria, criteria, con);
490         }
491     }
492
493     /**
494      * Method to do deletes.
495      *
496      * @param criteria object containing data that is used DELETE from database.
497      * @throws TorqueException Any exceptions caught during processing will be
498      * rethrown wrapped into a TorqueException.
499      */

500      public static void doDelete(Criteria criteria) throws TorqueException
501      {
502          RModuleOptionPeer
503             .doDelete(criteria, (Connection JavaDoc) null);
504      }
505
506     /**
507      * Method to do deletes. This method is to be used during a transaction,
508      * otherwise use the doDelete(Criteria) method. It will take care of
509      * the connection details internally.
510      *
511      * @param criteria object containing data that is used DELETE from database.
512      * @param con the connection to use
513      * @throws TorqueException Any exceptions caught during processing will be
514      * rethrown wrapped into a TorqueException.
515      */

516      public static void doDelete(Criteria criteria, Connection JavaDoc con)
517         throws TorqueException
518      {
519                                       // check for conversion from boolean to int
520
if (criteria.containsKey(ACTIVE))
521         {
522             Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
523             if (possibleBoolean instanceof Boolean JavaDoc)
524             {
525                 criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
526             }
527          }
528                   
529         setDbName(criteria);
530
531         if (con == null)
532         {
533             BasePeer.doDelete(criteria);
534         }
535         else
536         {
537             BasePeer.doDelete(criteria, con);
538         }
539      }
540
541     /**
542      * Method to do selects
543      *
544      * @throws TorqueException Any exceptions caught during processing will be
545      * rethrown wrapped into a TorqueException.
546      */

547     public static List JavaDoc doSelect(RModuleOption obj) throws TorqueException
548     {
549         return doSelect(buildSelectCriteria(obj));
550     }
551
552     /**
553      * Method to do inserts
554      *
555      * @throws TorqueException Any exceptions caught during processing will be
556      * rethrown wrapped into a TorqueException.
557      */

558     public static void doInsert(RModuleOption obj) throws TorqueException
559     {
560           doInsert(buildCriteria(obj));
561           obj.setNew(false);
562         obj.setModified(false);
563     }
564
565     /**
566      * @param obj the data object to update in the database.
567      * @throws TorqueException Any exceptions caught during processing will be
568      * rethrown wrapped into a TorqueException.
569      */

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

581     public static void doDelete(RModuleOption obj) throws TorqueException
582     {
583         doDelete(buildSelectCriteria(obj));
584     }
585
586     /**
587      * Method to do inserts. This method is to be used during a transaction,
588      * otherwise use the doInsert(RModuleOption) method. It will take
589      * care of the connection details internally.
590      *
591      * @param obj the data object to insert into the database.
592      * @param con the connection to use
593      * @throws TorqueException Any exceptions caught during processing will be
594      * rethrown wrapped into a TorqueException.
595      */

596     public static void doInsert(RModuleOption obj, Connection JavaDoc con)
597         throws TorqueException
598     {
599           doInsert(buildCriteria(obj), con);
600           obj.setNew(false);
601         obj.setModified(false);
602     }
603
604     /**
605      * Method to do update. This method is to be used during a transaction,
606      * otherwise use the doUpdate(RModuleOption) method. It will take
607      * care of the connection details internally.
608      *
609      * @param obj the data object to update in the database.
610      * @param con the connection to use
611      * @throws TorqueException Any exceptions caught during processing will be
612      * rethrown wrapped into a TorqueException.
613      */

614     public static void doUpdate(RModuleOption obj, Connection JavaDoc con)
615         throws TorqueException
616     {
617         doUpdate(buildCriteria(obj), con);
618         obj.setModified(false);
619     }
620
621     /**
622      * Method to delete. This method is to be used during a transaction,
623      * otherwise use the doDelete(RModuleOption) method. It will take
624      * care of the connection details internally.
625      *
626      * @param obj the data object to delete in the database.
627      * @param con the connection to use
628      * @throws TorqueException Any exceptions caught during processing will be
629      * rethrown wrapped into a TorqueException.
630      */

631     public static void doDelete(RModuleOption obj, Connection JavaDoc con)
632         throws TorqueException
633     {
634         doDelete(buildSelectCriteria(obj), con);
635     }
636
637     /**
638      * Method to do deletes.
639      *
640      * @param pk ObjectKey that is used DELETE from database.
641      * @throws TorqueException Any exceptions caught during processing will be
642      * rethrown wrapped into a TorqueException.
643      */

644     public static void doDelete(ObjectKey pk) throws TorqueException
645     {
646         BaseRModuleOptionPeer
647            .doDelete(pk, (Connection JavaDoc) null);
648     }
649
650     /**
651      * Method to delete. This method is to be used during a transaction,
652      * otherwise use the doDelete(ObjectKey) method. It will take
653      * care of the connection details internally.
654      *
655      * @param pk the primary key for the object to delete in the database.
656      * @param con the connection to use
657      * @throws TorqueException Any exceptions caught during processing will be
658      * rethrown wrapped into a TorqueException.
659      */

660     public static void doDelete(ObjectKey pk, Connection JavaDoc con)
661         throws TorqueException
662     {
663         doDelete(buildCriteria(pk), con);
664     }
665
666     /** Build a Criteria object from an ObjectKey */
667     public static Criteria buildCriteria( ObjectKey pk )
668     {
669         Criteria criteria = new Criteria();
670           SimpleKey[] keys = (SimpleKey[])pk.getValue();
671                     criteria.add(MODULE_ID, keys[0]);
672                       criteria.add(ISSUE_TYPE_ID, keys[1]);
673                       criteria.add(OPTION_ID, keys[2]);
674                     return criteria;
675      }
676
677     /** Build a Criteria object from the data object for this peer */
678     public static Criteria buildCriteria( RModuleOption obj )
679     {
680         Criteria criteria = new Criteria(DATABASE_NAME);
681               criteria.add(MODULE_ID, obj.getModuleId());
682               criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId());
683               criteria.add(OPTION_ID, obj.getOptionId());
684               criteria.add(DISPLAY_VALUE, obj.getDisplayValue());
685               criteria.add(ACTIVE, obj.getActive());
686               criteria.add(PREFERRED_ORDER, obj.getOrder());
687               criteria.add(WEIGHT, obj.getWeight());
688           return criteria;
689     }
690
691     /** Build a Criteria object from the data object for this peer, skipping all binary columns */
692     public static Criteria buildSelectCriteria( RModuleOption obj )
693     {
694         Criteria criteria = new Criteria(DATABASE_NAME);
695                       criteria.add(MODULE_ID, obj.getModuleId());
696                           criteria.add(ISSUE_TYPE_ID, obj.getIssueTypeId());
697                           criteria.add(OPTION_ID, obj.getOptionId());
698                           criteria.add(DISPLAY_VALUE, obj.getDisplayValue());
699                           criteria.add(ACTIVE, obj.getActive());
700                           criteria.add(PREFERRED_ORDER, obj.getOrder());
701                           criteria.add(WEIGHT, obj.getWeight());
702               return criteria;
703     }
704  
705     
706     
707     /**
708      * Retrieve a single object by pk
709      *
710      * @param pk the primary key
711      * @throws TorqueException Any exceptions caught during processing will be
712      * rethrown wrapped into a TorqueException.
713      * @throws NoRowsException Primary key was not found in database.
714      * @throws TooManyRowsException Primary key was not found in database.
715      */

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

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

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

794     public static List JavaDoc retrieveByPKs( List JavaDoc pks, Connection JavaDoc dbcon )
795         throws TorqueException
796     {
797         List JavaDoc objs = null;
798         if (pks == null || pks.size() == 0)
799         {
800             objs = new LinkedList JavaDoc();
801         }
802         else
803         {
804             Criteria criteria = new Criteria();
805               Iterator JavaDoc iter = pks.iterator();
806             while (iter.hasNext())
807             {
808                 ObjectKey pk = (ObjectKey)iter.next();
809                 SimpleKey[] keys = (SimpleKey[])pk.getValue();
810                             Criteria.Criterion c0 = criteria.getNewCriterion(
811                         MODULE_ID, keys[0], Criteria.EQUAL);
812                                     Criteria.Criterion c1 = criteria.getNewCriterion(
813                         ISSUE_TYPE_ID, keys[1], Criteria.EQUAL);
814                                     c0.and(c1);
815                               Criteria.Criterion c2 = criteria.getNewCriterion(
816                         OPTION_ID, keys[2], Criteria.EQUAL);
817                                     c1.and(c2);
818                           criteria.or(c0);
819             }
820           objs = doSelect(criteria, dbcon);
821         }
822         return objs;
823     }
824
825  
826     /**
827      * retrieve object using using pk values.
828      *
829        * @param module_id Integer
830        * @param issue_type_id Integer
831        * @param option_id Integer
832        */

833     public static RModuleOption retrieveByPK(
834        Integer JavaDoc module_id
835           , Integer JavaDoc issue_type_id
836           , Integer JavaDoc option_id
837               ) throws TorqueException
838     {
839         Connection JavaDoc db = null;
840         RModuleOption retVal = null;
841         try
842         {
843            db = Torque.getConnection(DATABASE_NAME);
844            retVal = retrieveByPK(
845          module_id
846           , issue_type_id
847           , option_id
848                      , db);
849         }
850         finally
851         {
852             Torque.closeConnection(db);
853         }
854         return(retVal);
855     }
856
857       /**
858      * retrieve object using using pk values.
859      *
860        * @param module_id Integer
861        * @param issue_type_id Integer
862        * @param option_id Integer
863        * @param con Connection
864      */

865     public static RModuleOption retrieveByPK(
866        Integer JavaDoc module_id
867           , Integer JavaDoc issue_type_id
868           , Integer JavaDoc option_id
869              ,Connection JavaDoc con) throws TorqueException
870     {
871
872         Criteria criteria = new Criteria(5);
873           criteria.add(MODULE_ID, module_id);
874           criteria.add(ISSUE_TYPE_ID, issue_type_id);
875           criteria.add(OPTION_ID, option_id);
876           List JavaDoc v = doSelect(criteria, con);
877         if (v.size() != 1)
878         {
879             throw new TorqueException("Failed to select one and only one row.");
880         }
881         else
882         {
883             return (RModuleOption) v.get(0);
884         }
885     }
886
887
888
889               
890                                               
891                 
892                 
893
894     /**
895      * selects a collection of RModuleOption objects pre-filled with their
896      * AttributeOption objects.
897      *
898      * This method is protected by default in order to keep the public
899      * api reasonable. You can provide public methods for those you
900      * actually need in RModuleOptionPeer.
901      *
902      * @throws TorqueException Any exceptions caught during processing will be
903      * rethrown wrapped into a TorqueException.
904      */

905     protected static List JavaDoc doSelectJoinAttributeOption(Criteria criteria)
906         throws TorqueException
907     {
908         setDbName(criteria);
909
910         RModuleOptionPeer.addSelectColumns(criteria);
911         int offset = numColumns + 1;
912         AttributeOptionPeer.addSelectColumns(criteria);
913
914
915                         criteria.addJoin(RModuleOptionPeer.OPTION_ID,
916             AttributeOptionPeer.OPTION_ID);
917         
918
919                                                                                                   // check for conversion from boolean to int
920
if (criteria.containsKey(ACTIVE))
921         {
922             Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
923             if (possibleBoolean instanceof Boolean JavaDoc)
924             {
925                 criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
926             }
927          }
928                                                       
929         List JavaDoc rows = BasePeer.doSelect(criteria);
930         List JavaDoc results = new ArrayList JavaDoc();
931
932         for (int i = 0; i < rows.size(); i++)
933         {
934             Record row = (Record) rows.get(i);
935
936                             Class JavaDoc omClass = RModuleOptionPeer.getOMClass();
937                     RModuleOption obj1 = (RModuleOption) RModuleOptionPeer
938                 .row2Object(row, 1, omClass);
939                      omClass = AttributeOptionPeer.getOMClass();
940                     AttributeOption obj2 = (AttributeOption)AttributeOptionPeer
941                 .row2Object(row, offset, omClass);
942
943             boolean newObject = true;
944             for (int j = 0; j < results.size(); j++)
945             {
946                 RModuleOption temp_obj1 = (RModuleOption)results.get(j);
947                 AttributeOption temp_obj2 = (AttributeOption)temp_obj1.getAttributeOption();
948                 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
949                 {
950                     newObject = false;
951                               temp_obj2.addRModuleOption(obj1);
952                               break;
953                 }
954             }
955                       if (newObject)
956             {
957                 obj2.initRModuleOptions();
958                 obj2.addRModuleOption(obj1);
959             }
960                       results.add(obj1);
961         }
962         return results;
963     }
964                                                             
965                         
966                 
967
968     /**
969      * selects a collection of RModuleOption objects pre-filled with their
970      * ScarabModule objects.
971      *
972      * This method is protected by default in order to keep the public
973      * api reasonable. You can provide public methods for those you
974      * actually need in RModuleOptionPeer.
975      *
976      * @throws TorqueException Any exceptions caught during processing will be
977      * rethrown wrapped into a TorqueException.
978      */

979     protected static List JavaDoc doSelectJoinScarabModule(Criteria criteria)
980         throws TorqueException
981     {
982         setDbName(criteria);
983
984         RModuleOptionPeer.addSelectColumns(criteria);
985         int offset = numColumns + 1;
986         ScarabModulePeer.addSelectColumns(criteria);
987
988
989                         criteria.addJoin(RModuleOptionPeer.MODULE_ID,
990             ScarabModulePeer.MODULE_ID);
991         
992
993                                                                                                   // check for conversion from boolean to int
994
if (criteria.containsKey(ACTIVE))
995         {
996             Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
997             if (possibleBoolean instanceof Boolean JavaDoc)
998             {
999                 criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1000            }
1001         }
1002                                                      
1003        List JavaDoc rows = BasePeer.doSelect(criteria);
1004        List JavaDoc results = new ArrayList JavaDoc();
1005
1006        for (int i = 0; i < rows.size(); i++)
1007        {
1008            Record row = (Record) rows.get(i);
1009
1010                            Class JavaDoc omClass = RModuleOptionPeer.getOMClass();
1011                    RModuleOption obj1 = (RModuleOption) RModuleOptionPeer
1012                .row2Object(row, 1, omClass);
1013                     omClass = ScarabModulePeer.getOMClass(row, offset);
1014                    ScarabModule obj2 = (ScarabModule)ScarabModulePeer
1015                .row2Object(row, offset, omClass);
1016
1017            boolean newObject = true;
1018            for (int j = 0; j < results.size(); j++)
1019            {
1020                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1021                ScarabModule temp_obj2 = (ScarabModule)temp_obj1.getModule();
1022                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1023                {
1024                    newObject = false;
1025                              temp_obj2.addRModuleOption(obj1);
1026                              break;
1027                }
1028            }
1029                      if (newObject)
1030            {
1031                obj2.initRModuleOptions();
1032                obj2.addRModuleOption(obj1);
1033            }
1034                      results.add(obj1);
1035        }
1036        return results;
1037    }
1038                                                            
1039                
1040                
1041
1042    /**
1043     * selects a collection of RModuleOption objects pre-filled with their
1044     * IssueType objects.
1045     *
1046     * This method is protected by default in order to keep the public
1047     * api reasonable. You can provide public methods for those you
1048     * actually need in RModuleOptionPeer.
1049     *
1050     * @throws TorqueException Any exceptions caught during processing will be
1051     * rethrown wrapped into a TorqueException.
1052     */

1053    protected static List JavaDoc doSelectJoinIssueType(Criteria criteria)
1054        throws TorqueException
1055    {
1056        setDbName(criteria);
1057
1058        RModuleOptionPeer.addSelectColumns(criteria);
1059        int offset = numColumns + 1;
1060        IssueTypePeer.addSelectColumns(criteria);
1061
1062
1063                        criteria.addJoin(RModuleOptionPeer.ISSUE_TYPE_ID,
1064            IssueTypePeer.ISSUE_TYPE_ID);
1065        
1066
1067                                                                                                  // check for conversion from boolean to int
1068
if (criteria.containsKey(ACTIVE))
1069        {
1070            Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
1071            if (possibleBoolean instanceof Boolean JavaDoc)
1072            {
1073                criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1074            }
1075         }
1076                                                      
1077        List JavaDoc rows = BasePeer.doSelect(criteria);
1078        List JavaDoc results = new ArrayList JavaDoc();
1079
1080        for (int i = 0; i < rows.size(); i++)
1081        {
1082            Record row = (Record) rows.get(i);
1083
1084                            Class JavaDoc omClass = RModuleOptionPeer.getOMClass();
1085                    RModuleOption obj1 = (RModuleOption) RModuleOptionPeer
1086                .row2Object(row, 1, omClass);
1087                     omClass = IssueTypePeer.getOMClass();
1088                    IssueType obj2 = (IssueType)IssueTypePeer
1089                .row2Object(row, offset, omClass);
1090
1091            boolean newObject = true;
1092            for (int j = 0; j < results.size(); j++)
1093            {
1094                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1095                IssueType temp_obj2 = (IssueType)temp_obj1.getIssueType();
1096                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1097                {
1098                    newObject = false;
1099                              temp_obj2.addRModuleOption(obj1);
1100                              break;
1101                }
1102            }
1103                      if (newObject)
1104            {
1105                obj2.initRModuleOptions();
1106                obj2.addRModuleOption(obj1);
1107            }
1108                      results.add(obj1);
1109        }
1110        return results;
1111    }
1112                    
1113  
1114                                    
1115          
1116        
1117                                  
1118                
1119
1120    /**
1121     * selects a collection of RModuleOption objects pre-filled with
1122     * all related objects.
1123     *
1124     * This method is protected by default in order to keep the public
1125     * api reasonable. You can provide public methods for those you
1126     * actually need in RModuleOptionPeer.
1127     *
1128     * @throws TorqueException Any exceptions caught during processing will be
1129     * rethrown wrapped into a TorqueException.
1130     */

1131    protected static List JavaDoc doSelectJoinAllExceptAttributeOption(Criteria criteria)
1132        throws TorqueException
1133    {
1134        setDbName(criteria);
1135
1136        addSelectColumns(criteria);
1137        int offset2 = numColumns + 1;
1138                                    
1139                                                  
1140                    ScarabModulePeer.addSelectColumns(criteria);
1141        int offset3 = offset2 + ScarabModulePeer.numColumns;
1142                                                                
1143                    IssueTypePeer.addSelectColumns(criteria);
1144        int offset4 = offset3 + IssueTypePeer.numColumns;
1145                                                                                                                                              // check for conversion from boolean to int
1146
if (criteria.containsKey(ACTIVE))
1147        {
1148            Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
1149            if (possibleBoolean instanceof Boolean JavaDoc)
1150            {
1151                criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1152            }
1153         }
1154                                                      
1155        List JavaDoc rows = BasePeer.doSelect(criteria);
1156        List JavaDoc results = new ArrayList JavaDoc();
1157
1158        for (int i = 0; i < rows.size(); i++)
1159        {
1160            Record row = (Record)rows.get(i);
1161
1162                            Class JavaDoc omClass = RModuleOptionPeer.getOMClass();
1163                    RModuleOption obj1 = (RModuleOption)RModuleOptionPeer
1164                .row2Object(row, 1, omClass);
1165                                                
1166                                                                              
1167                                                        
1168                            
1169              
1170                           omClass = ScarabModulePeer.getOMClass(row, offset2);
1171                          ScarabModule obj2 = (ScarabModule)ScarabModulePeer
1172                .row2Object( row, offset2, omClass);
1173
1174               boolean newObject = true;
1175            for (int j = 0; j < results.size(); j++)
1176            {
1177                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1178                ScarabModule temp_obj2 = (ScarabModule)temp_obj1.getModule();
1179                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1180                {
1181                    newObject = false;
1182                                    temp_obj2.addRModuleOption(obj1);
1183                                    break;
1184                }
1185            }
1186                            if (newObject)
1187            {
1188                obj2.initRModuleOptions();
1189                obj2.addRModuleOption(obj1);
1190            }
1191                                                                                    
1192                                                        
1193                            
1194              
1195                           omClass = IssueTypePeer.getOMClass();
1196                          IssueType obj3 = (IssueType)IssueTypePeer
1197                .row2Object( row, offset3, omClass);
1198
1199               newObject = true;
1200            for (int j = 0; j < results.size(); j++)
1201            {
1202                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1203                IssueType temp_obj3 = (IssueType)temp_obj1.getIssueType();
1204                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1205                {
1206                    newObject = false;
1207                                    temp_obj3.addRModuleOption(obj1);
1208                                    break;
1209                }
1210            }
1211                            if (newObject)
1212            {
1213                obj3.initRModuleOptions();
1214                obj3.addRModuleOption(obj1);
1215            }
1216                                                                results.add(obj1);
1217        }
1218        return results;
1219    }
1220        
1221        
1222                                  
1223                
1224
1225    /**
1226     * selects a collection of RModuleOption objects pre-filled with
1227     * all related objects.
1228     *
1229     * This method is protected by default in order to keep the public
1230     * api reasonable. You can provide public methods for those you
1231     * actually need in RModuleOptionPeer.
1232     *
1233     * @throws TorqueException Any exceptions caught during processing will be
1234     * rethrown wrapped into a TorqueException.
1235     */

1236    protected static List JavaDoc doSelectJoinAllExceptScarabModule(Criteria criteria)
1237        throws TorqueException
1238    {
1239        setDbName(criteria);
1240
1241        addSelectColumns(criteria);
1242        int offset2 = numColumns + 1;
1243                                    
1244                    AttributeOptionPeer.addSelectColumns(criteria);
1245        int offset3 = offset2 + AttributeOptionPeer.numColumns;
1246                                                                
1247                                                  
1248                    IssueTypePeer.addSelectColumns(criteria);
1249        int offset4 = offset3 + IssueTypePeer.numColumns;
1250                                                                                                                                              // check for conversion from boolean to int
1251
if (criteria.containsKey(ACTIVE))
1252        {
1253            Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
1254            if (possibleBoolean instanceof Boolean JavaDoc)
1255            {
1256                criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1257            }
1258         }
1259                                                      
1260        List JavaDoc rows = BasePeer.doSelect(criteria);
1261        List JavaDoc results = new ArrayList JavaDoc();
1262
1263        for (int i = 0; i < rows.size(); i++)
1264        {
1265            Record row = (Record)rows.get(i);
1266
1267                            Class JavaDoc omClass = RModuleOptionPeer.getOMClass();
1268                    RModuleOption obj1 = (RModuleOption)RModuleOptionPeer
1269                .row2Object(row, 1, omClass);
1270                                                
1271                                                        
1272                            
1273              
1274                           omClass = AttributeOptionPeer.getOMClass();
1275                          AttributeOption obj2 = (AttributeOption)AttributeOptionPeer
1276                .row2Object( row, offset2, omClass);
1277
1278               boolean newObject = true;
1279            for (int j = 0; j < results.size(); j++)
1280            {
1281                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1282                AttributeOption temp_obj2 = (AttributeOption)temp_obj1.getAttributeOption();
1283                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1284                {
1285                    newObject = false;
1286                                    temp_obj2.addRModuleOption(obj1);
1287                                    break;
1288                }
1289            }
1290                            if (newObject)
1291            {
1292                obj2.initRModuleOptions();
1293                obj2.addRModuleOption(obj1);
1294            }
1295                                                                                                
1296                                                                  
1297                                                        
1298                            
1299              
1300                           omClass = IssueTypePeer.getOMClass();
1301                          IssueType obj3 = (IssueType)IssueTypePeer
1302                .row2Object( row, offset3, omClass);
1303
1304               newObject = true;
1305            for (int j = 0; j < results.size(); j++)
1306            {
1307                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1308                IssueType temp_obj3 = (IssueType)temp_obj1.getIssueType();
1309                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1310                {
1311                    newObject = false;
1312                                    temp_obj3.addRModuleOption(obj1);
1313                                    break;
1314                }
1315            }
1316                            if (newObject)
1317            {
1318                obj3.initRModuleOptions();
1319                obj3.addRModuleOption(obj1);
1320            }
1321                                                                results.add(obj1);
1322        }
1323        return results;
1324    }
1325        
1326        
1327                                  
1328                
1329
1330    /**
1331     * selects a collection of RModuleOption objects pre-filled with
1332     * all related objects.
1333     *
1334     * This method is protected by default in order to keep the public
1335     * api reasonable. You can provide public methods for those you
1336     * actually need in RModuleOptionPeer.
1337     *
1338     * @throws TorqueException Any exceptions caught during processing will be
1339     * rethrown wrapped into a TorqueException.
1340     */

1341    protected static List JavaDoc doSelectJoinAllExceptIssueType(Criteria criteria)
1342        throws TorqueException
1343    {
1344        setDbName(criteria);
1345
1346        addSelectColumns(criteria);
1347        int offset2 = numColumns + 1;
1348                                    
1349                    AttributeOptionPeer.addSelectColumns(criteria);
1350        int offset3 = offset2 + AttributeOptionPeer.numColumns;
1351                                                                
1352                    ScarabModulePeer.addSelectColumns(criteria);
1353        int offset4 = offset3 + ScarabModulePeer.numColumns;
1354                                                                
1355                                                                                                                                // check for conversion from boolean to int
1356
if (criteria.containsKey(ACTIVE))
1357        {
1358            Object JavaDoc possibleBoolean = criteria.get(ACTIVE);
1359            if (possibleBoolean instanceof Boolean JavaDoc)
1360            {
1361                criteria.add(ACTIVE, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1362            }
1363         }
1364                                                      
1365        List JavaDoc rows = BasePeer.doSelect(criteria);
1366        List JavaDoc results = new ArrayList JavaDoc();
1367
1368        for (int i = 0; i < rows.size(); i++)
1369        {
1370            Record row = (Record)rows.get(i);
1371
1372                            Class JavaDoc omClass = RModuleOptionPeer.getOMClass();
1373                    RModuleOption obj1 = (RModuleOption)RModuleOptionPeer
1374                .row2Object(row, 1, omClass);
1375                                                
1376                                                        
1377                            
1378              
1379                           omClass = AttributeOptionPeer.getOMClass();
1380                          AttributeOption obj2 = (AttributeOption)AttributeOptionPeer
1381                .row2Object( row, offset2, omClass);
1382
1383               boolean newObject = true;
1384            for (int j = 0; j < results.size(); j++)
1385            {
1386                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1387                AttributeOption temp_obj2 = (AttributeOption)temp_obj1.getAttributeOption();
1388                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1389                {
1390                    newObject = false;
1391                                    temp_obj2.addRModuleOption(obj1);
1392                                    break;
1393                }
1394            }
1395                            if (newObject)
1396            {
1397                obj2.initRModuleOptions();
1398                obj2.addRModuleOption(obj1);
1399            }
1400                                                                                                
1401                                                        
1402                            
1403              
1404                           omClass = ScarabModulePeer.getOMClass(row, offset3);
1405                          ScarabModule obj3 = (ScarabModule)ScarabModulePeer
1406                .row2Object( row, offset3, omClass);
1407
1408               newObject = true;
1409            for (int j = 0; j < results.size(); j++)
1410            {
1411                RModuleOption temp_obj1 = (RModuleOption)results.get(j);
1412                ScarabModule temp_obj3 = (ScarabModule)temp_obj1.getModule();
1413                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1414                {
1415                    newObject = false;
1416                                    temp_obj3.addRModuleOption(obj1);
1417                                    break;
1418                }
1419            }
1420                            if (newObject)
1421            {
1422                obj3.initRModuleOptions();
1423                obj3.addRModuleOption(obj1);
1424            }
1425                                                                                    
1426                                              results.add(obj1);
1427        }
1428        return results;
1429    }
1430                    
1431  
1432      /**
1433     * Returns the TableMap related to this peer. This method is not
1434     * needed for general use but a specific application could have a need.
1435     *
1436     * @throws TorqueException Any exceptions caught during processing will be
1437     * rethrown wrapped into a TorqueException.
1438     */

1439    protected static TableMap getTableMap()
1440        throws TorqueException
1441    {
1442        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
1443    }
1444   
1445    private static void setDbName(Criteria crit)
1446    {
1447        // Set the correct dbName if it has not been overridden
1448
// crit.getDbName will return the same object if not set to
1449
// another value so == check is okay and faster
1450
if (crit.getDbName() == Torque.getDefaultDB())
1451        {
1452            crit.setDbName(DATABASE_NAME);
1453        }
1454    }
1455}
1456
Popular Tags