KickJava   Java API By Example, From Geeks To Geeks.

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


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 BaseScarabModulePeer
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_MODULE";
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(ScarabModuleMapBuilder.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 MODULE_NAME field */
63     public static final String JavaDoc MODULE_NAME;
64       /** the column name for the DOMAIN field */
65     public static final String JavaDoc DOMAIN;
66       /** the column name for the MODULE_CODE field */
67     public static final String JavaDoc MODULE_CODE;
68       /** the column name for the MODULE_DESCRIPTION field */
69     public static final String JavaDoc MODULE_DESCRIPTION;
70       /** the column name for the MODULE_URL field */
71     public static final String JavaDoc MODULE_URL;
72       /** the column name for the ARCHIVE_EMAIL field */
73     public static final String JavaDoc ARCHIVE_EMAIL;
74       /** the column name for the PARENT_ID field */
75     public static final String JavaDoc PARENT_ID;
76       /** the column name for the OWNER_ID field */
77     public static final String JavaDoc OWNER_ID;
78       /** the column name for the QA_CONTACT_ID field */
79     public static final String JavaDoc QA_CONTACT_ID;
80       /** the column name for the DELETED field */
81     public static final String JavaDoc DELETED;
82       /** the column name for the LOCKED field */
83     public static final String JavaDoc LOCKED;
84       /** the column name for the CLASS_KEY field */
85     public static final String JavaDoc CLASS_KEY;
86   
87     static
88     {
89           MODULE_ID = "SCARAB_MODULE.MODULE_ID";
90           MODULE_NAME = "SCARAB_MODULE.MODULE_NAME";
91           DOMAIN = "SCARAB_MODULE.DOMAIN";
92           MODULE_CODE = "SCARAB_MODULE.MODULE_CODE";
93           MODULE_DESCRIPTION = "SCARAB_MODULE.MODULE_DESCRIPTION";
94           MODULE_URL = "SCARAB_MODULE.MODULE_URL";
95           ARCHIVE_EMAIL = "SCARAB_MODULE.ARCHIVE_EMAIL";
96           PARENT_ID = "SCARAB_MODULE.PARENT_ID";
97           OWNER_ID = "SCARAB_MODULE.OWNER_ID";
98           QA_CONTACT_ID = "SCARAB_MODULE.QA_CONTACT_ID";
99           DELETED = "SCARAB_MODULE.DELETED";
100           LOCKED = "SCARAB_MODULE.LOCKED";
101           CLASS_KEY = "SCARAB_MODULE.CLASS_KEY";
102           if (Torque.isInit())
103         {
104             try
105             {
106                 getMapBuilder(ScarabModuleMapBuilder.CLASS_NAME);
107             }
108             catch (Exception JavaDoc e)
109             {
110                 log.error("Could not initialize Peer", e);
111             }
112         }
113         else
114         {
115             Torque.registerMapBuilder(ScarabModuleMapBuilder.CLASS_NAME);
116         }
117     }
118  
119     /** number of columns for this peer */
120     public static final int numColumns = 13;
121
122     /** A class that can be returned by this peer. */
123     protected static final String JavaDoc CLASSNAME_DEFAULT =
124         "org.tigris.scarab.om.ScarabModule";
125
126     /** A class that can be returned by this peer. */
127     protected static final Class JavaDoc CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
128
129     /**
130      * Class object initialization method.
131      *
132      * @param className name of the class to initialize
133      * @return the initialized class
134      */

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

169     public static List JavaDoc resultSet2Objects(java.sql.ResultSet JavaDoc results)
170             throws TorqueException
171     {
172         try
173         {
174             QueryDataSet qds = null;
175             List JavaDoc rows = null;
176             try
177             {
178                 qds = new QueryDataSet(results);
179                 rows = getSelectResults(qds);
180             }
181             finally
182             {
183                 if (qds != null)
184                 {
185                     qds.close();
186                 }
187             }
188
189             return populateObjects(rows);
190         }
191         catch (SQLException JavaDoc e)
192         {
193             throw new TorqueException(e);
194         }
195         catch (DataSetException e)
196         {
197             throw new TorqueException(e);
198         }
199     }
200
201
202   
203     
204                             
205           /** A key representing a particular subclass */
206     public static final int CLASSKEY_1 =
207         1;
208
209     /** A class that can be returned by this peer. */
210     public static final String JavaDoc CLASSNAME_1 =
211         "org.tigris.scarab.om.ScarabModuleContainer";
212
213     /** A class that can be returned by this peer. */
214     public static final Class JavaDoc CLASS_1 =
215         initClass(CLASSNAME_1);
216             
217     /**
218      * Method to do inserts.
219      *
220      * @param criteria object used to create the INSERT statement.
221      * @throws TorqueException Any exceptions caught during processing will be
222      * rethrown wrapped into a TorqueException.
223      */

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

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

282     public static void addSelectColumns(Criteria criteria)
283             throws TorqueException
284     {
285           criteria.addSelectColumn(MODULE_ID);
286           criteria.addSelectColumn(MODULE_NAME);
287           criteria.addSelectColumn(DOMAIN);
288           criteria.addSelectColumn(MODULE_CODE);
289           criteria.addSelectColumn(MODULE_DESCRIPTION);
290           criteria.addSelectColumn(MODULE_URL);
291           criteria.addSelectColumn(ARCHIVE_EMAIL);
292           criteria.addSelectColumn(PARENT_ID);
293           criteria.addSelectColumn(OWNER_ID);
294           criteria.addSelectColumn(QA_CONTACT_ID);
295           criteria.addSelectColumn(DELETED);
296           criteria.addSelectColumn(LOCKED);
297           criteria.addSelectColumn(CLASS_KEY);
298       }
299
300     /**
301      * Create a new object of type cls from a resultset row starting
302      * from a specified offset. This is done so that you can select
303      * other rows than just those needed for this object. You may
304      * for example want to create two objects from the same row.
305      *
306      * @throws TorqueException Any exceptions caught during processing will be
307      * rethrown wrapped into a TorqueException.
308      */

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

342     public static void populateObject(Record row,
343                                       int offset,
344                                       ScarabModule obj)
345         throws TorqueException
346     {
347         try
348         {
349                 obj.setModuleId(row.getValue(offset + 0).asIntegerObj());
350                   obj.setRealName(row.getValue(offset + 1).asString());
351                   obj.setDomain(row.getValue(offset + 2).asString());
352                   obj.setCode(row.getValue(offset + 3).asString());
353                   obj.setDescription(row.getValue(offset + 4).asString());
354                   obj.setUrl(row.getValue(offset + 5).asString());
355                   obj.setArchiveEmail(row.getValue(offset + 6).asString());
356                   obj.setParentId(row.getValue(offset + 7).asIntegerObj());
357                   obj.setOwnerId(row.getValue(offset + 8).asIntegerObj());
358                   obj.setQaContactId(row.getValue(offset + 9).asIntegerObj());
359                   obj.setDeleted(row.getValue(offset + 10).asBoolean());
360                   obj.setLocked(row.getValue(offset + 11).asBoolean());
361                   obj.setClassKey(row.getValue(offset + 12).asInt());
362               }
363         catch (DataSetException e)
364         {
365             throw new TorqueException(e);
366         }
367     }
368
369     /**
370      * Method to do selects.
371      *
372      * @param criteria object used to create the SELECT statement.
373      * @return List of selected Objects
374      * @throws TorqueException Any exceptions caught during processing will be
375      * rethrown wrapped into a TorqueException.
376      */

377     public static List JavaDoc doSelect(Criteria criteria) throws TorqueException
378     {
379         return populateObjects(doSelectVillageRecords(criteria));
380     }
381
382     /**
383      * Method to do selects within a transaction.
384      *
385      * @param criteria object used to create the SELECT statement.
386      * @param con the connection to use
387      * @return List of selected Objects
388      * @throws TorqueException Any exceptions caught during processing will be
389      * rethrown wrapped into a TorqueException.
390      */

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

407     public static List JavaDoc doSelectVillageRecords(Criteria criteria)
408         throws TorqueException
409     {
410         return BaseScarabModulePeer
411             .doSelectVillageRecords(criteria, (Connection JavaDoc) null);
412     }
413
414     /**
415      * Grabs the raw Village records to be formed into objects.
416      * This method should be used for transactions
417      *
418      * @param criteria object used to create the SELECT statement.
419      * @param con the connection to use
420      * @throws TorqueException Any exceptions caught during processing will be
421      * rethrown wrapped into a TorqueException.
422      */

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

471     public static List JavaDoc populateObjects(List JavaDoc records)
472         throws TorqueException
473     {
474         List JavaDoc results = new ArrayList JavaDoc(records.size());
475
476         // populate the object(s)
477
for (int i = 0; i < records.size(); i++)
478         {
479             Record row = (Record) records.get(i);
480               results.add(ScarabModulePeer.row2Object(row, 1,
481                 ScarabModulePeer.getOMClass(row, 1)));
482           }
483         return results;
484     }
485  
486     /**
487      * The returned Class will contain objects of the default type or
488      * objects that inherit from the default.
489      *
490      * @throws TorqueException Any exceptions caught during processing will be
491      * rethrown wrapped into a TorqueException.
492      */

493     public static Class JavaDoc getOMClass(Record record, int offset)
494         throws TorqueException
495     {
496         Class JavaDoc c = null;
497         try
498         {
499               Class JavaDoc omClass = null;
500             int classKey =
501                 record.getValue(offset - 1 + 13)
502                 .asInt();
503                           if (classKey == CLASSKEY_1)
504                   {
505                 omClass = CLASS_1;
506             }
507                       else
508             {
509                 omClass = getOMClass();
510             }
511             c = omClass;
512           }
513         catch (Exception JavaDoc e)
514         {
515             throw new TorqueException(e);
516         }
517         return c;
518     }
519
520     /**
521      * The class that the Peer will make instances of.
522      * If the BO is abstract then you must implement this method
523      * in the BO.
524      *
525      * @throws TorqueException Any exceptions caught during processing will be
526      * rethrown wrapped into a TorqueException.
527      */

528     public static Class JavaDoc getOMClass()
529         throws TorqueException
530     {
531         return CLASS_DEFAULT;
532     }
533
534     /**
535      * Method to do updates.
536      *
537      * @param criteria object containing data that is used to create the UPDATE
538      * statement.
539      * @throws TorqueException Any exceptions caught during processing will be
540      * rethrown wrapped into a TorqueException.
541      */

542     public static void doUpdate(Criteria criteria) throws TorqueException
543     {
544          BaseScarabModulePeer
545             .doUpdate(criteria, (Connection JavaDoc) null);
546     }
547
548     /**
549      * Method to do updates. This method is to be used during a transaction,
550      * otherwise use the doUpdate(Criteria) method. It will take care of
551      * the connection details internally.
552      *
553      * @param criteria object containing data that is used to create the UPDATE
554      * statement.
555      * @param con the connection to use
556      * @throws TorqueException Any exceptions caught during processing will be
557      * rethrown wrapped into a TorqueException.
558      */

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

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

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

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

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

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

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

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

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

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

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

771     public static void doDelete(ObjectKey pk, Connection JavaDoc con)
772         throws TorqueException
773     {
774         doDelete(buildCriteria(pk), con);
775     }
776
777     /** Build a Criteria object from an ObjectKey */
778     public static Criteria buildCriteria( ObjectKey pk )
779     {
780         Criteria criteria = new Criteria();
781               criteria.add(MODULE_ID, pk);
782           return criteria;
783      }
784
785     /** Build a Criteria object from the data object for this peer */
786     public static Criteria buildCriteria( ScarabModule obj )
787     {
788         Criteria criteria = new Criteria(DATABASE_NAME);
789               if (!obj.isNew())
790             criteria.add(MODULE_ID, obj.getModuleId());
791               criteria.add(MODULE_NAME, obj.getRealName());
792               criteria.add(DOMAIN, obj.getDomain());
793               criteria.add(MODULE_CODE, obj.getCode());
794               criteria.add(MODULE_DESCRIPTION, obj.getDescription());
795               criteria.add(MODULE_URL, obj.getUrl());
796               criteria.add(ARCHIVE_EMAIL, obj.getArchiveEmail());
797               criteria.add(PARENT_ID, obj.getParentId());
798               criteria.add(OWNER_ID, obj.getOwnerId());
799               criteria.add(QA_CONTACT_ID, obj.getQaContactId());
800               criteria.add(DELETED, obj.getDeleted());
801               criteria.add(LOCKED, obj.getLocked());
802               criteria.add(CLASS_KEY, obj.getClassKey());
803           return criteria;
804     }
805
806     /** Build a Criteria object from the data object for this peer, skipping all binary columns */
807     public static Criteria buildSelectCriteria( ScarabModule obj )
808     {
809         Criteria criteria = new Criteria(DATABASE_NAME);
810               if (!obj.isNew())
811                     criteria.add(MODULE_ID, obj.getModuleId());
812                           criteria.add(MODULE_NAME, obj.getRealName());
813                           criteria.add(DOMAIN, obj.getDomain());
814                           criteria.add(MODULE_CODE, obj.getCode());
815                           criteria.add(MODULE_DESCRIPTION, obj.getDescription());
816                           criteria.add(MODULE_URL, obj.getUrl());
817                           criteria.add(ARCHIVE_EMAIL, obj.getArchiveEmail());
818                           criteria.add(PARENT_ID, obj.getParentId());
819                           criteria.add(OWNER_ID, obj.getOwnerId());
820                           criteria.add(QA_CONTACT_ID, obj.getQaContactId());
821                           criteria.add(DELETED, obj.getDeleted());
822                           criteria.add(LOCKED, obj.getLocked());
823                           criteria.add(CLASS_KEY, obj.getClassKey());
824               return criteria;
825     }
826  
827     
828         /**
829      * Retrieve a single object by pk
830      *
831      * @param pk the primary key
832      * @throws TorqueException Any exceptions caught during processing will be
833      * rethrown wrapped into a TorqueException.
834      * @throws NoRowsException Primary key was not found in database.
835      * @throws TooManyRowsException Primary key was not found in database.
836      */

837     public static ScarabModule retrieveByPK(Integer JavaDoc pk)
838         throws TorqueException, NoRowsException, TooManyRowsException
839     {
840         return retrieveByPK(SimpleKey.keyFor(pk));
841     }
842
843     /**
844      * Retrieve a single object by pk
845      *
846      * @param pk the primary key
847      * @param con the connection to use
848      * @throws TorqueException Any exceptions caught during processing will be
849      * rethrown wrapped into a TorqueException.
850      * @throws NoRowsException Primary key was not found in database.
851      * @throws TooManyRowsException Primary key was not found in database.
852      */

853     public static ScarabModule retrieveByPK(Integer JavaDoc pk, Connection JavaDoc con)
854         throws TorqueException, NoRowsException, TooManyRowsException
855     {
856         return retrieveByPK(SimpleKey.keyFor(pk), con);
857     }
858   
859     /**
860      * Retrieve a single object by pk
861      *
862      * @param pk the primary key
863      * @throws TorqueException Any exceptions caught during processing will be
864      * rethrown wrapped into a TorqueException.
865      * @throws NoRowsException Primary key was not found in database.
866      * @throws TooManyRowsException Primary key was not found in database.
867      */

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

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

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

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

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

1066    protected static List JavaDoc doSelectJoinScarabUserImplRelatedByQaContactId(Criteria criteria)
1067        throws TorqueException
1068    {
1069        setDbName(criteria);
1070
1071        ScarabModulePeer.addSelectColumns(criteria);
1072        int offset = numColumns + 1;
1073        ScarabUserImplPeer.addSelectColumns(criteria);
1074
1075
1076                        criteria.addJoin(ScarabModulePeer.QA_CONTACT_ID,
1077            ScarabUserImplPeer.USER_ID);
1078        
1079
1080                                                                                                                                                                                                              // check for conversion from boolean to int
1081
if (criteria.containsKey(DELETED))
1082        {
1083            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1084            if (possibleBoolean instanceof Boolean JavaDoc)
1085            {
1086                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1087            }
1088         }
1089                                    // check for conversion from boolean to int
1090
if (criteria.containsKey(LOCKED))
1091        {
1092            Object JavaDoc possibleBoolean = criteria.get(LOCKED);
1093            if (possibleBoolean instanceof Boolean JavaDoc)
1094            {
1095                criteria.add(LOCKED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1096            }
1097         }
1098                                    
1099        List JavaDoc rows = BasePeer.doSelect(criteria);
1100        List JavaDoc results = new ArrayList JavaDoc();
1101
1102        for (int i = 0; i < rows.size(); i++)
1103        {
1104            Record row = (Record) rows.get(i);
1105
1106                            Class JavaDoc omClass = ScarabModulePeer.getOMClass(row, 1);
1107                    ScarabModule obj1 = (ScarabModule) ScarabModulePeer
1108                .row2Object(row, 1, omClass);
1109                     omClass = ScarabUserImplPeer.getOMClass();
1110                    ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
1111                .row2Object(row, offset, omClass);
1112
1113            boolean newObject = true;
1114            for (int j = 0; j < results.size(); j++)
1115            {
1116                ScarabModule temp_obj1 = (ScarabModule)results.get(j);
1117                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByQaContactId();
1118                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1119                {
1120                    newObject = false;
1121                              temp_obj2.addScarabModuleRelatedByQaContactId(obj1);
1122                              break;
1123                }
1124            }
1125                      if (newObject)
1126            {
1127                obj2.initScarabModulesRelatedByQaContactId();
1128                obj2.addScarabModuleRelatedByQaContactId(obj1);
1129            }
1130                      results.add(obj1);
1131        }
1132        return results;
1133    }
1134                    
1135  
1136                                    
1137          
1138        
1139                                  
1140                
1141
1142    /**
1143     * selects a collection of ScarabModule objects pre-filled with
1144     * all related objects.
1145     *
1146     * This method is protected by default in order to keep the public
1147     * api reasonable. You can provide public methods for those you
1148     * actually need in ScarabModulePeer.
1149     *
1150     * @throws TorqueException Any exceptions caught during processing will be
1151     * rethrown wrapped into a TorqueException.
1152     */

1153    protected static List JavaDoc doSelectJoinAllExceptScarabModule(Criteria criteria)
1154        throws TorqueException
1155    {
1156        setDbName(criteria);
1157
1158        addSelectColumns(criteria);
1159        int offset2 = numColumns + 1;
1160                                                                
1161                    ScarabUserImplPeer.addSelectColumns(criteria);
1162        int offset3 = offset2 + ScarabUserImplPeer.numColumns;
1163                                                                
1164                    ScarabUserImplPeer.addSelectColumns(criteria);
1165        int offset4 = offset3 + ScarabUserImplPeer.numColumns;
1166                                                                                                                                                                                                                                                          // check for conversion from boolean to int
1167
if (criteria.containsKey(DELETED))
1168        {
1169            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1170            if (possibleBoolean instanceof Boolean JavaDoc)
1171            {
1172                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1173            }
1174         }
1175                                    // check for conversion from boolean to int
1176
if (criteria.containsKey(LOCKED))
1177        {
1178            Object JavaDoc possibleBoolean = criteria.get(LOCKED);
1179            if (possibleBoolean instanceof Boolean JavaDoc)
1180            {
1181                criteria.add(LOCKED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1182            }
1183         }
1184                                    
1185        List JavaDoc rows = BasePeer.doSelect(criteria);
1186        List JavaDoc results = new ArrayList JavaDoc();
1187
1188        for (int i = 0; i < rows.size(); i++)
1189        {
1190            Record row = (Record)rows.get(i);
1191
1192                            Class JavaDoc omClass = ScarabModulePeer.getOMClass(row, 1);
1193                    ScarabModule obj1 = (ScarabModule)ScarabModulePeer
1194                .row2Object(row, 1, omClass);
1195                                                                                          
1196                                                                        
1197                            
1198              
1199                           omClass = ScarabUserImplPeer.getOMClass();
1200                          ScarabUserImpl obj2 = (ScarabUserImpl)ScarabUserImplPeer
1201                .row2Object( row, offset2, omClass);
1202
1203               boolean newObject = true;
1204            for (int j = 0; j < results.size(); j++)
1205            {
1206                ScarabModule temp_obj1 = (ScarabModule)results.get(j);
1207                ScarabUserImpl temp_obj2 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByOwnerId();
1208                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1209                {
1210                    newObject = false;
1211                                    temp_obj2.addScarabModuleRelatedByOwnerId(obj1);
1212                                    break;
1213                }
1214            }
1215                            if (newObject)
1216            {
1217                obj2.initScarabModulesRelatedByOwnerId();
1218                obj2.addScarabModuleRelatedByOwnerId(obj1);
1219            }
1220                                                                                                
1221                                                                        
1222                            
1223              
1224                           omClass = ScarabUserImplPeer.getOMClass();
1225                          ScarabUserImpl obj3 = (ScarabUserImpl)ScarabUserImplPeer
1226                .row2Object( row, offset3, omClass);
1227
1228               newObject = true;
1229            for (int j = 0; j < results.size(); j++)
1230            {
1231                ScarabModule temp_obj1 = (ScarabModule)results.get(j);
1232                ScarabUserImpl temp_obj3 = (ScarabUserImpl)temp_obj1.getScarabUserRelatedByQaContactId();
1233                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1234                {
1235                    newObject = false;
1236                                    temp_obj3.addScarabModuleRelatedByQaContactId(obj1);
1237                                    break;
1238                }
1239            }
1240                            if (newObject)
1241            {
1242                obj3.initScarabModulesRelatedByQaContactId();
1243                obj3.addScarabModuleRelatedByQaContactId(obj1);
1244            }
1245                                                                results.add(obj1);
1246        }
1247        return results;
1248    }
1249        
1250        
1251                                            
1252                
1253
1254    /**
1255     * selects a collection of ScarabModule objects pre-filled with
1256     * all related 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 ScarabModulePeer.
1261     *
1262     * @throws TorqueException Any exceptions caught during processing will be
1263     * rethrown wrapped into a TorqueException.
1264     */

1265    protected static List JavaDoc doSelectJoinAllExceptScarabUserImplRelatedByOwnerId(Criteria criteria)
1266        throws TorqueException
1267    {
1268        setDbName(criteria);
1269
1270        addSelectColumns(criteria);
1271        int offset2 = numColumns + 1;
1272                                                                
1273                                                  
1274                                                                                                                                                                                                                                            // check for conversion from boolean to int
1275
if (criteria.containsKey(DELETED))
1276        {
1277            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1278            if (possibleBoolean instanceof Boolean JavaDoc)
1279            {
1280                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1281            }
1282         }
1283                                    // check for conversion from boolean to int
1284
if (criteria.containsKey(LOCKED))
1285        {
1286            Object JavaDoc possibleBoolean = criteria.get(LOCKED);
1287            if (possibleBoolean instanceof Boolean JavaDoc)
1288            {
1289                criteria.add(LOCKED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1290            }
1291         }
1292                                    
1293        List JavaDoc rows = BasePeer.doSelect(criteria);
1294        List JavaDoc results = new ArrayList JavaDoc();
1295
1296        for (int i = 0; i < rows.size(); i++)
1297        {
1298            Record row = (Record)rows.get(i);
1299
1300                            Class JavaDoc omClass = ScarabModulePeer.getOMClass(row, 1);
1301                    ScarabModule obj1 = (ScarabModule)ScarabModulePeer
1302                .row2Object(row, 1, omClass);
1303                                                                                          
1304                                                                              
1305                                              results.add(obj1);
1306        }
1307        return results;
1308    }
1309        
1310        
1311                                            
1312                
1313
1314    /**
1315     * selects a collection of ScarabModule objects pre-filled with
1316     * all related objects.
1317     *
1318     * This method is protected by default in order to keep the public
1319     * api reasonable. You can provide public methods for those you
1320     * actually need in ScarabModulePeer.
1321     *
1322     * @throws TorqueException Any exceptions caught during processing will be
1323     * rethrown wrapped into a TorqueException.
1324     */

1325    protected static List JavaDoc doSelectJoinAllExceptScarabUserImplRelatedByQaContactId(Criteria criteria)
1326        throws TorqueException
1327    {
1328        setDbName(criteria);
1329
1330        addSelectColumns(criteria);
1331        int offset2 = numColumns + 1;
1332                                                                
1333                                                  
1334                                                                                                                                                                                                                                            // check for conversion from boolean to int
1335
if (criteria.containsKey(DELETED))
1336        {
1337            Object JavaDoc possibleBoolean = criteria.get(DELETED);
1338            if (possibleBoolean instanceof Boolean JavaDoc)
1339            {
1340                criteria.add(DELETED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1341            }
1342         }
1343                                    // check for conversion from boolean to int
1344
if (criteria.containsKey(LOCKED))
1345        {
1346            Object JavaDoc possibleBoolean = criteria.get(LOCKED);
1347            if (possibleBoolean instanceof Boolean JavaDoc)
1348            {
1349                criteria.add(LOCKED, ((Boolean JavaDoc) possibleBoolean).booleanValue() ? 1 : 0);
1350            }
1351         }
1352                                    
1353        List JavaDoc rows = BasePeer.doSelect(criteria);
1354        List JavaDoc results = new ArrayList JavaDoc();
1355
1356        for (int i = 0; i < rows.size(); i++)
1357        {
1358            Record row = (Record)rows.get(i);
1359
1360                            Class JavaDoc omClass = ScarabModulePeer.getOMClass(row, 1);
1361                    ScarabModule obj1 = (ScarabModule)ScarabModulePeer
1362                .row2Object(row, 1, omClass);
1363                                                                                          
1364                                                                              
1365                                              results.add(obj1);
1366        }
1367        return results;
1368    }
1369                    
1370  
1371      /**
1372     * Returns the TableMap related to this peer. This method is not
1373     * needed for general use but a specific application could have a need.
1374     *
1375     * @throws TorqueException Any exceptions caught during processing will be
1376     * rethrown wrapped into a TorqueException.
1377     */

1378    protected static TableMap getTableMap()
1379        throws TorqueException
1380    {
1381        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
1382    }
1383   
1384    private static void setDbName(Criteria crit)
1385    {
1386        // Set the correct dbName if it has not been overridden
1387
// crit.getDbName will return the same object if not set to
1388
// another value so == check is okay and faster
1389
if (crit.getDbName() == Torque.getDefaultDB())
1390        {
1391            crit.setDbName(DATABASE_NAME);
1392        }
1393    }
1394}
1395
Popular Tags