KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > campware > cream > om > BasePrintSubscriptionPeer


1 package org.campware.cream.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.campware.cream.om.map.*;
32
33
34   
35   
36   
37   
38   
39   
40 /**
41  * This class was autogenerated by Torque on:
42  *
43  * [Wed May 04 09:10:56 CEST 2005]
44  *
45  */

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

61     public static MapBuilder getMapBuilder()
62         throws TorqueException
63     {
64         return getMapBuilder(PrintSubscriptionMapBuilder.CLASS_NAME);
65     }
66
67       /** the column name for the PRINT_SUBS_ID field */
68     public static final String JavaDoc PRINT_SUBS_ID;
69       /** the column name for the PRINT_SUBS_CODE field */
70     public static final String JavaDoc PRINT_SUBS_CODE;
71       /** the column name for the STATUS field */
72     public static final String JavaDoc STATUS;
73       /** the column name for the PRIORITY field */
74     public static final String JavaDoc PRIORITY;
75       /** the column name for the ISSUED_DATE field */
76     public static final String JavaDoc ISSUED_DATE;
77       /** the column name for the CLOSED_DATE field */
78     public static final String JavaDoc CLOSED_DATE;
79       /** the column name for the SORDER_ID field */
80     public static final String JavaDoc SORDER_ID;
81       /** the column name for the CUSTOMER_ID field */
82     public static final String JavaDoc CUSTOMER_ID;
83       /** the column name for the RECIPIENT_ID field */
84     public static final String JavaDoc RECIPIENT_ID;
85       /** the column name for the CARRIER_ID field */
86     public static final String JavaDoc CARRIER_ID;
87       /** the column name for the PROJECT_ID field */
88     public static final String JavaDoc PROJECT_ID;
89       /** the column name for the PRODUCT_ID field */
90     public static final String JavaDoc PRODUCT_ID;
91       /** the column name for the QUANTITY field */
92     public static final String JavaDoc QUANTITY;
93       /** the column name for the START_DATE field */
94     public static final String JavaDoc START_DATE;
95       /** the column name for the END_DATE field */
96     public static final String JavaDoc END_DATE;
97       /** the column name for the SUBJECT field */
98     public static final String JavaDoc SUBJECT;
99       /** the column name for the NOTES field */
100     public static final String JavaDoc NOTES;
101       /** the column name for the CREATED field */
102     public static final String JavaDoc CREATED;
103       /** the column name for the MODIFIED field */
104     public static final String JavaDoc MODIFIED;
105       /** the column name for the CREATED_BY field */
106     public static final String JavaDoc CREATED_BY;
107       /** the column name for the MODIFIED_BY field */
108     public static final String JavaDoc MODIFIED_BY;
109   
110     static
111     {
112           PRINT_SUBS_ID = "PRINT_SUBSCRIPTION.PRINT_SUBS_ID";
113           PRINT_SUBS_CODE = "PRINT_SUBSCRIPTION.PRINT_SUBS_CODE";
114           STATUS = "PRINT_SUBSCRIPTION.STATUS";
115           PRIORITY = "PRINT_SUBSCRIPTION.PRIORITY";
116           ISSUED_DATE = "PRINT_SUBSCRIPTION.ISSUED_DATE";
117           CLOSED_DATE = "PRINT_SUBSCRIPTION.CLOSED_DATE";
118           SORDER_ID = "PRINT_SUBSCRIPTION.SORDER_ID";
119           CUSTOMER_ID = "PRINT_SUBSCRIPTION.CUSTOMER_ID";
120           RECIPIENT_ID = "PRINT_SUBSCRIPTION.RECIPIENT_ID";
121           CARRIER_ID = "PRINT_SUBSCRIPTION.CARRIER_ID";
122           PROJECT_ID = "PRINT_SUBSCRIPTION.PROJECT_ID";
123           PRODUCT_ID = "PRINT_SUBSCRIPTION.PRODUCT_ID";
124           QUANTITY = "PRINT_SUBSCRIPTION.QUANTITY";
125           START_DATE = "PRINT_SUBSCRIPTION.START_DATE";
126           END_DATE = "PRINT_SUBSCRIPTION.END_DATE";
127           SUBJECT = "PRINT_SUBSCRIPTION.SUBJECT";
128           NOTES = "PRINT_SUBSCRIPTION.NOTES";
129           CREATED = "PRINT_SUBSCRIPTION.CREATED";
130           MODIFIED = "PRINT_SUBSCRIPTION.MODIFIED";
131           CREATED_BY = "PRINT_SUBSCRIPTION.CREATED_BY";
132           MODIFIED_BY = "PRINT_SUBSCRIPTION.MODIFIED_BY";
133           if (Torque.isInit())
134         {
135             try
136             {
137                 getMapBuilder(PrintSubscriptionMapBuilder.CLASS_NAME);
138             }
139             catch (Exception JavaDoc e)
140             {
141                 log.error("Could not initialize Peer", e);
142             }
143         }
144         else
145         {
146             Torque.registerMapBuilder(PrintSubscriptionMapBuilder.CLASS_NAME);
147         }
148     }
149  
150     /** number of columns for this peer */
151     public static final int numColumns = 21;
152
153     /** A class that can be returned by this peer. */
154     protected static final String JavaDoc CLASSNAME_DEFAULT =
155         "org.campware.cream.om.PrintSubscription";
156
157     /** A class that can be returned by this peer. */
158     protected static final Class JavaDoc CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
159
160     /**
161      * Class object initialization method.
162      *
163      * @param className name of the class to initialize
164      * @return the initialized class
165      */

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

200     public static List JavaDoc resultSet2Objects(java.sql.ResultSet JavaDoc results)
201             throws TorqueException
202     {
203         try
204         {
205             QueryDataSet qds = null;
206             List JavaDoc rows = null;
207             try
208             {
209                 qds = new QueryDataSet(results);
210                 rows = getSelectResults(qds);
211             }
212             finally
213             {
214                 if (qds != null)
215                 {
216                     qds.close();
217                 }
218             }
219
220             return populateObjects(rows);
221         }
222         catch (SQLException JavaDoc e)
223         {
224             throw new TorqueException(e);
225         }
226         catch (DataSetException e)
227         {
228             throw new TorqueException(e);
229         }
230     }
231
232
233   
234     /**
235      * Method to do inserts.
236      *
237      * @param criteria object used to create the INSERT statement.
238      * @throws TorqueException Any exceptions caught during processing will be
239      * rethrown wrapped into a TorqueException.
240      */

241     public static ObjectKey doInsert(Criteria criteria)
242         throws TorqueException
243     {
244         return BasePrintSubscriptionPeer
245             .doInsert(criteria, (Connection JavaDoc) null);
246     }
247
248     /**
249      * Method to do inserts. This method is to be used during a transaction,
250      * otherwise use the doInsert(Criteria) method. It will take care of
251      * the connection details internally.
252      *
253      * @param criteria object used to create the INSERT statement.
254      * @param con the connection to use
255      * @throws TorqueException Any exceptions caught during processing will be
256      * rethrown wrapped into a TorqueException.
257      */

258     public static ObjectKey doInsert(Criteria criteria, Connection JavaDoc con)
259         throws TorqueException
260     {
261                                                                                                                                 
262         setDbName(criteria);
263
264         if (con == null)
265         {
266             return BasePeer.doInsert(criteria);
267         }
268         else
269         {
270             return BasePeer.doInsert(criteria, con);
271         }
272     }
273
274     /**
275      * Add all the columns needed to create a new object.
276      *
277      * @param criteria object containing the columns to add.
278      * @throws TorqueException Any exceptions caught during processing will be
279      * rethrown wrapped into a TorqueException.
280      */

281     public static void addSelectColumns(Criteria criteria)
282             throws TorqueException
283     {
284           criteria.addSelectColumn(PRINT_SUBS_ID);
285           criteria.addSelectColumn(PRINT_SUBS_CODE);
286           criteria.addSelectColumn(STATUS);
287           criteria.addSelectColumn(PRIORITY);
288           criteria.addSelectColumn(ISSUED_DATE);
289           criteria.addSelectColumn(CLOSED_DATE);
290           criteria.addSelectColumn(SORDER_ID);
291           criteria.addSelectColumn(CUSTOMER_ID);
292           criteria.addSelectColumn(RECIPIENT_ID);
293           criteria.addSelectColumn(CARRIER_ID);
294           criteria.addSelectColumn(PROJECT_ID);
295           criteria.addSelectColumn(PRODUCT_ID);
296           criteria.addSelectColumn(QUANTITY);
297           criteria.addSelectColumn(START_DATE);
298           criteria.addSelectColumn(END_DATE);
299           criteria.addSelectColumn(SUBJECT);
300           criteria.addSelectColumn(NOTES);
301           criteria.addSelectColumn(CREATED);
302           criteria.addSelectColumn(MODIFIED);
303           criteria.addSelectColumn(CREATED_BY);
304           criteria.addSelectColumn(MODIFIED_BY);
305       }
306
307     /**
308      * Create a new object of type cls from a resultset row starting
309      * from a specified offset. This is done so that you can select
310      * other rows than just those needed for this object. You may
311      * for example want to create two objects from the same row.
312      *
313      * @throws TorqueException Any exceptions caught during processing will be
314      * rethrown wrapped into a TorqueException.
315      */

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

349     public static void populateObject(Record row,
350                                       int offset,
351                                       PrintSubscription obj)
352         throws TorqueException
353     {
354         try
355         {
356                 obj.setPrintSubsId(row.getValue(offset + 0).asInt());
357                   obj.setPrintSubsCode(row.getValue(offset + 1).asString());
358                   obj.setStatus(row.getValue(offset + 2).asInt());
359                   obj.setPriority(row.getValue(offset + 3).asInt());
360                   obj.setIssuedDate(row.getValue(offset + 4).asUtilDate());
361                   obj.setClosedDate(row.getValue(offset + 5).asUtilDate());
362                   obj.setSorderId(row.getValue(offset + 6).asInt());
363                   obj.setCustomerId(row.getValue(offset + 7).asInt());
364                   obj.setRecipientId(row.getValue(offset + 8).asInt());
365                   obj.setCarrierId(row.getValue(offset + 9).asInt());
366                   obj.setProjectId(row.getValue(offset + 10).asInt());
367                   obj.setProductId(row.getValue(offset + 11).asInt());
368                   obj.setQuantity(row.getValue(offset + 12).asInt());
369                   obj.setStartDate(row.getValue(offset + 13).asUtilDate());
370                   obj.setEndDate(row.getValue(offset + 14).asUtilDate());
371                   obj.setSubject(row.getValue(offset + 15).asString());
372                   obj.setNotes(row.getValue(offset + 16).asString());
373                   obj.setCreated(row.getValue(offset + 17).asUtilDate());
374                   obj.setModified(row.getValue(offset + 18).asUtilDate());
375                   obj.setCreatedBy(row.getValue(offset + 19).asString());
376                   obj.setModifiedBy(row.getValue(offset + 20).asString());
377               }
378         catch (DataSetException e)
379         {
380             throw new TorqueException(e);
381         }
382     }
383
384     /**
385      * Method to do selects.
386      *
387      * @param criteria object used to create the SELECT statement.
388      * @return List of selected Objects
389      * @throws TorqueException Any exceptions caught during processing will be
390      * rethrown wrapped into a TorqueException.
391      */

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

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

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

438     public static List JavaDoc doSelectVillageRecords(Criteria criteria, Connection JavaDoc con)
439         throws TorqueException
440     {
441         if (criteria.getSelectColumns().size() == 0)
442         {
443             addSelectColumns(criteria);
444         }
445
446                                                                                                                                 
447         setDbName(criteria);
448
449         // BasePeer returns a List of Value (Village) arrays. The array
450
// order follows the order columns were placed in the Select clause.
451
if (con == null)
452         {
453             return BasePeer.doSelect(criteria);
454         }
455         else
456         {
457             return BasePeer.doSelect(criteria, con);
458         }
459     }
460
461     /**
462      * The returned List will contain objects of the default type or
463      * objects that inherit from the default.
464      *
465      * @throws TorqueException Any exceptions caught during processing will be
466      * rethrown wrapped into a TorqueException.
467      */

468     public static List JavaDoc populateObjects(List JavaDoc records)
469         throws TorqueException
470     {
471         List JavaDoc results = new ArrayList JavaDoc(records.size());
472
473         // populate the object(s)
474
for (int i = 0; i < records.size(); i++)
475         {
476             Record row = (Record) records.get(i);
477               results.add(PrintSubscriptionPeer.row2Object(row, 1,
478                 PrintSubscriptionPeer.getOMClass()));
479           }
480         return results;
481     }
482  
483
484     /**
485      * The class that the Peer will make instances of.
486      * If the BO is abstract then you must implement this method
487      * in the BO.
488      *
489      * @throws TorqueException Any exceptions caught during processing will be
490      * rethrown wrapped into a TorqueException.
491      */

492     public static Class JavaDoc getOMClass()
493         throws TorqueException
494     {
495         return CLASS_DEFAULT;
496     }
497
498     /**
499      * Method to do updates.
500      *
501      * @param criteria object containing data that is used to create the UPDATE
502      * statement.
503      * @throws TorqueException Any exceptions caught during processing will be
504      * rethrown wrapped into a TorqueException.
505      */

506     public static void doUpdate(Criteria criteria) throws TorqueException
507     {
508          BasePrintSubscriptionPeer
509             .doUpdate(criteria, (Connection JavaDoc) null);
510     }
511
512     /**
513      * Method to do updates. This method is to be used during a transaction,
514      * otherwise use the doUpdate(Criteria) method. It will take care of
515      * the connection details internally.
516      *
517      * @param criteria object containing data that is used to create the UPDATE
518      * statement.
519      * @param con the connection to use
520      * @throws TorqueException Any exceptions caught during processing will be
521      * rethrown wrapped into a TorqueException.
522      */

523     public static void doUpdate(Criteria criteria, Connection JavaDoc con)
524         throws TorqueException
525     {
526         Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
527                    selectCriteria.put(PRINT_SUBS_ID, criteria.remove(PRINT_SUBS_ID));
528                                                                                                                                                                                                               
529         setDbName(criteria);
530
531         if (con == null)
532         {
533             BasePeer.doUpdate(selectCriteria, criteria);
534         }
535         else
536         {
537             BasePeer.doUpdate(selectCriteria, criteria, con);
538         }
539     }
540
541     /**
542      * Method to do deletes.
543      *
544      * @param criteria object containing data that is used DELETE from database.
545      * @throws TorqueException Any exceptions caught during processing will be
546      * rethrown wrapped into a TorqueException.
547      */

548      public static void doDelete(Criteria criteria) throws TorqueException
549      {
550          PrintSubscriptionPeer
551             .doDelete(criteria, (Connection JavaDoc) null);
552      }
553
554     /**
555      * Method to do deletes. This method is to be used during a transaction,
556      * otherwise use the doDelete(Criteria) method. It will take care of
557      * the connection details internally.
558      *
559      * @param criteria object containing data that is used DELETE from database.
560      * @param con the connection to use
561      * @throws TorqueException Any exceptions caught during processing will be
562      * rethrown wrapped into a TorqueException.
563      */

564      public static void doDelete(Criteria criteria, Connection JavaDoc con)
565         throws TorqueException
566      {
567                                                                                                                                 
568         setDbName(criteria);
569
570         if (con == null)
571         {
572             BasePeer.doDelete(criteria);
573         }
574         else
575         {
576             BasePeer.doDelete(criteria, con);
577         }
578      }
579
580     /**
581      * Method to do selects
582      *
583      * @throws TorqueException Any exceptions caught during processing will be
584      * rethrown wrapped into a TorqueException.
585      */

586     public static List JavaDoc doSelect(PrintSubscription obj) throws TorqueException
587     {
588         return doSelect(buildSelectCriteria(obj));
589     }
590
591     /**
592      * Method to do inserts
593      *
594      * @throws TorqueException Any exceptions caught during processing will be
595      * rethrown wrapped into a TorqueException.
596      */

597     public static void doInsert(PrintSubscription obj) throws TorqueException
598     {
599           obj.setPrimaryKey(doInsert(buildCriteria(obj)));
600           obj.setNew(false);
601         obj.setModified(false);
602     }
603
604     /**
605      * @param obj the data object to update in the database.
606      * @throws TorqueException Any exceptions caught during processing will be
607      * rethrown wrapped into a TorqueException.
608      */

609     public static void doUpdate(PrintSubscription obj) throws TorqueException
610     {
611         doUpdate(buildCriteria(obj));
612         obj.setModified(false);
613     }
614
615     /**
616      * @param obj the data object to delete in the database.
617      * @throws TorqueException Any exceptions caught during processing will be
618      * rethrown wrapped into a TorqueException.
619      */

620     public static void doDelete(PrintSubscription obj) throws TorqueException
621     {
622         doDelete(buildSelectCriteria(obj));
623     }
624
625     /**
626      * Method to do inserts. This method is to be used during a transaction,
627      * otherwise use the doInsert(PrintSubscription) method. It will take
628      * care of the connection details internally.
629      *
630      * @param obj the data object to insert into the database.
631      * @param con the connection to use
632      * @throws TorqueException Any exceptions caught during processing will be
633      * rethrown wrapped into a TorqueException.
634      */

635     public static void doInsert(PrintSubscription obj, Connection JavaDoc con)
636         throws TorqueException
637     {
638           obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
639           obj.setNew(false);
640         obj.setModified(false);
641     }
642
643     /**
644      * Method to do update. This method is to be used during a transaction,
645      * otherwise use the doUpdate(PrintSubscription) method. It will take
646      * care of the connection details internally.
647      *
648      * @param obj the data object to update in the database.
649      * @param con the connection to use
650      * @throws TorqueException Any exceptions caught during processing will be
651      * rethrown wrapped into a TorqueException.
652      */

653     public static void doUpdate(PrintSubscription obj, Connection JavaDoc con)
654         throws TorqueException
655     {
656         doUpdate(buildCriteria(obj), con);
657         obj.setModified(false);
658     }
659
660     /**
661      * Method to delete. This method is to be used during a transaction,
662      * otherwise use the doDelete(PrintSubscription) method. It will take
663      * care of the connection details internally.
664      *
665      * @param obj the data object to delete in the database.
666      * @param con the connection to use
667      * @throws TorqueException Any exceptions caught during processing will be
668      * rethrown wrapped into a TorqueException.
669      */

670     public static void doDelete(PrintSubscription obj, Connection JavaDoc con)
671         throws TorqueException
672     {
673         doDelete(buildSelectCriteria(obj), con);
674     }
675
676     /**
677      * Method to do deletes.
678      *
679      * @param pk ObjectKey that is used DELETE from database.
680      * @throws TorqueException Any exceptions caught during processing will be
681      * rethrown wrapped into a TorqueException.
682      */

683     public static void doDelete(ObjectKey pk) throws TorqueException
684     {
685         BasePrintSubscriptionPeer
686            .doDelete(pk, (Connection JavaDoc) null);
687     }
688
689     /**
690      * Method to delete. This method is to be used during a transaction,
691      * otherwise use the doDelete(ObjectKey) method. It will take
692      * care of the connection details internally.
693      *
694      * @param pk the primary key for the object to delete in the database.
695      * @param con the connection to use
696      * @throws TorqueException Any exceptions caught during processing will be
697      * rethrown wrapped into a TorqueException.
698      */

699     public static void doDelete(ObjectKey pk, Connection JavaDoc con)
700         throws TorqueException
701     {
702         doDelete(buildCriteria(pk), con);
703     }
704
705     /** Build a Criteria object from an ObjectKey */
706     public static Criteria buildCriteria( ObjectKey pk )
707     {
708         Criteria criteria = new Criteria();
709               criteria.add(PRINT_SUBS_ID, pk);
710           return criteria;
711      }
712
713     /** Build a Criteria object from the data object for this peer */
714     public static Criteria buildCriteria( PrintSubscription obj )
715     {
716         Criteria criteria = new Criteria(DATABASE_NAME);
717               if (!obj.isNew())
718             criteria.add(PRINT_SUBS_ID, obj.getPrintSubsId());
719               criteria.add(PRINT_SUBS_CODE, obj.getPrintSubsCode());
720               criteria.add(STATUS, obj.getStatus());
721               criteria.add(PRIORITY, obj.getPriority());
722               criteria.add(ISSUED_DATE, obj.getIssuedDate());
723               criteria.add(CLOSED_DATE, obj.getClosedDate());
724               criteria.add(SORDER_ID, obj.getSorderId());
725               criteria.add(CUSTOMER_ID, obj.getCustomerId());
726               criteria.add(RECIPIENT_ID, obj.getRecipientId());
727               criteria.add(CARRIER_ID, obj.getCarrierId());
728               criteria.add(PROJECT_ID, obj.getProjectId());
729               criteria.add(PRODUCT_ID, obj.getProductId());
730               criteria.add(QUANTITY, obj.getQuantity());
731               criteria.add(START_DATE, obj.getStartDate());
732               criteria.add(END_DATE, obj.getEndDate());
733               criteria.add(SUBJECT, obj.getSubject());
734               criteria.add(NOTES, obj.getNotes());
735               criteria.add(CREATED, obj.getCreated());
736               criteria.add(MODIFIED, obj.getModified());
737               criteria.add(CREATED_BY, obj.getCreatedBy());
738               criteria.add(MODIFIED_BY, obj.getModifiedBy());
739           return criteria;
740     }
741
742     /** Build a Criteria object from the data object for this peer, skipping all binary columns */
743     public static Criteria buildSelectCriteria( PrintSubscription obj )
744     {
745         Criteria criteria = new Criteria(DATABASE_NAME);
746               if (!obj.isNew())
747                     criteria.add(PRINT_SUBS_ID, obj.getPrintSubsId());
748                           criteria.add(PRINT_SUBS_CODE, obj.getPrintSubsCode());
749                           criteria.add(STATUS, obj.getStatus());
750                           criteria.add(PRIORITY, obj.getPriority());
751                           criteria.add(ISSUED_DATE, obj.getIssuedDate());
752                           criteria.add(CLOSED_DATE, obj.getClosedDate());
753                           criteria.add(SORDER_ID, obj.getSorderId());
754                           criteria.add(CUSTOMER_ID, obj.getCustomerId());
755                           criteria.add(RECIPIENT_ID, obj.getRecipientId());
756                           criteria.add(CARRIER_ID, obj.getCarrierId());
757                           criteria.add(PROJECT_ID, obj.getProjectId());
758                           criteria.add(PRODUCT_ID, obj.getProductId());
759                           criteria.add(QUANTITY, obj.getQuantity());
760                           criteria.add(START_DATE, obj.getStartDate());
761                           criteria.add(END_DATE, obj.getEndDate());
762                           criteria.add(SUBJECT, obj.getSubject());
763                           criteria.add(NOTES, obj.getNotes());
764                           criteria.add(CREATED, obj.getCreated());
765                           criteria.add(MODIFIED, obj.getModified());
766                           criteria.add(CREATED_BY, obj.getCreatedBy());
767                           criteria.add(MODIFIED_BY, obj.getModifiedBy());
768               return criteria;
769     }
770  
771     
772         /**
773      * Retrieve a single object by pk
774      *
775      * @param pk the primary key
776      * @throws TorqueException Any exceptions caught during processing will be
777      * rethrown wrapped into a TorqueException.
778      * @throws NoRowsException Primary key was not found in database.
779      * @throws TooManyRowsException Primary key was not found in database.
780      */

781     public static PrintSubscription retrieveByPK(int pk)
782         throws TorqueException, NoRowsException, TooManyRowsException
783     {
784         return retrieveByPK(SimpleKey.keyFor(pk));
785     }
786
787     /**
788      * Retrieve a single object by pk
789      *
790      * @param pk the primary key
791      * @param con the connection to use
792      * @throws TorqueException Any exceptions caught during processing will be
793      * rethrown wrapped into a TorqueException.
794      * @throws NoRowsException Primary key was not found in database.
795      * @throws TooManyRowsException Primary key was not found in database.
796      */

797     public static PrintSubscription retrieveByPK(int pk, Connection JavaDoc con)
798         throws TorqueException, NoRowsException, TooManyRowsException
799     {
800         return retrieveByPK(SimpleKey.keyFor(pk), con);
801     }
802   
803     /**
804      * Retrieve a single object by pk
805      *
806      * @param pk the primary key
807      * @throws TorqueException Any exceptions caught during processing will be
808      * rethrown wrapped into a TorqueException.
809      * @throws NoRowsException Primary key was not found in database.
810      * @throws TooManyRowsException Primary key was not found in database.
811      */

812     public static PrintSubscription retrieveByPK(ObjectKey pk)
813         throws TorqueException, NoRowsException, TooManyRowsException
814     {
815         Connection JavaDoc db = null;
816         PrintSubscription retVal = null;
817         try
818         {
819             db = Torque.getConnection(DATABASE_NAME);
820             retVal = retrieveByPK(pk, db);
821         }
822         finally
823         {
824             Torque.closeConnection(db);
825         }
826         return(retVal);
827     }
828
829     /**
830      * Retrieve a single object by pk
831      *
832      * @param pk the primary key
833      * @param con the connection to use
834      * @throws TorqueException Any exceptions caught during processing will be
835      * rethrown wrapped into a TorqueException.
836      * @throws NoRowsException Primary key was not found in database.
837      * @throws TooManyRowsException Primary key was not found in database.
838      */

839     public static PrintSubscription retrieveByPK(ObjectKey pk, Connection JavaDoc con)
840         throws TorqueException, NoRowsException, TooManyRowsException
841     {
842         Criteria criteria = buildCriteria(pk);
843         List JavaDoc v = doSelect(criteria, con);
844         if (v.size() == 0)
845         {
846             throw new NoRowsException("Failed to select a row.");
847         }
848         else if (v.size() > 1)
849         {
850             throw new TooManyRowsException("Failed to select only one row.");
851         }
852         else
853         {
854             return (PrintSubscription)v.get(0);
855         }
856     }
857
858     /**
859      * Retrieve a multiple objects by pk
860      *
861      * @param pks List of primary keys
862      * @throws TorqueException Any exceptions caught during processing will be
863      * rethrown wrapped into a TorqueException.
864      */

865     public static List JavaDoc retrieveByPKs(List JavaDoc pks)
866         throws TorqueException
867     {
868         Connection JavaDoc db = null;
869         List JavaDoc retVal = null;
870         try
871         {
872            db = Torque.getConnection(DATABASE_NAME);
873            retVal = retrieveByPKs(pks, db);
874         }
875         finally
876         {
877             Torque.closeConnection(db);
878         }
879         return(retVal);
880     }
881
882     /**
883      * Retrieve a multiple objects by pk
884      *
885      * @param pks List of primary keys
886      * @param dbcon the connection to use
887      * @throws TorqueException Any exceptions caught during processing will be
888      * rethrown wrapped into a TorqueException.
889      */

890     public static List JavaDoc retrieveByPKs( List JavaDoc pks, Connection JavaDoc dbcon )
891         throws TorqueException
892     {
893         List JavaDoc objs = null;
894         if (pks == null || pks.size() == 0)
895         {
896             objs = new LinkedList JavaDoc();
897         }
898         else
899         {
900             Criteria criteria = new Criteria();
901               criteria.addIn( PRINT_SUBS_ID, pks );
902           objs = doSelect(criteria, dbcon);
903         }
904         return objs;
905     }
906
907  
908
909
910
911                     
912                                                         
913                 
914                 
915
916     /**
917      * selects a collection of PrintSubscription objects pre-filled with their
918      * Customer objects.
919      *
920      * This method is protected by default in order to keep the public
921      * api reasonable. You can provide public methods for those you
922      * actually need in PrintSubscriptionPeer.
923      *
924      * @throws TorqueException Any exceptions caught during processing will be
925      * rethrown wrapped into a TorqueException.
926      */

927     protected static List JavaDoc doSelectJoinCustomerRelatedByCustomerId(Criteria criteria)
928         throws TorqueException
929     {
930         setDbName(criteria);
931
932         PrintSubscriptionPeer.addSelectColumns(criteria);
933         int offset = numColumns + 1;
934         CustomerPeer.addSelectColumns(criteria);
935
936
937                         criteria.addJoin(PrintSubscriptionPeer.CUSTOMER_ID,
938             CustomerPeer.CUSTOMER_ID);
939         
940
941                                                                                                                                                                                                                                                                                                                                                                                                   
942         List JavaDoc rows = BasePeer.doSelect(criteria);
943         List JavaDoc results = new ArrayList JavaDoc();
944
945         for (int i = 0; i < rows.size(); i++)
946         {
947             Record row = (Record) rows.get(i);
948
949                             Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
950                     PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer
951                 .row2Object(row, 1, omClass);
952                      omClass = CustomerPeer.getOMClass();
953                     Customer obj2 = (Customer)CustomerPeer
954                 .row2Object(row, offset, omClass);
955
956             boolean newObject = true;
957             for (int j = 0; j < results.size(); j++)
958             {
959                 PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
960                 Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId();
961                 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
962                 {
963                     newObject = false;
964                               temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
965                               break;
966                 }
967             }
968                       if (newObject)
969             {
970                 obj2.initPrintSubscriptionsRelatedByCustomerId();
971                 obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
972             }
973                       results.add(obj1);
974         }
975         return results;
976     }
977                                                                       
978                 
979                 
980
981     /**
982      * selects a collection of PrintSubscription objects pre-filled with their
983      * Customer objects.
984      *
985      * This method is protected by default in order to keep the public
986      * api reasonable. You can provide public methods for those you
987      * actually need in PrintSubscriptionPeer.
988      *
989      * @throws TorqueException Any exceptions caught during processing will be
990      * rethrown wrapped into a TorqueException.
991      */

992     protected static List JavaDoc doSelectJoinCustomerRelatedByRecipientId(Criteria criteria)
993         throws TorqueException
994     {
995         setDbName(criteria);
996
997         PrintSubscriptionPeer.addSelectColumns(criteria);
998         int offset = numColumns + 1;
999         CustomerPeer.addSelectColumns(criteria);
1000
1001
1002                        criteria.addJoin(PrintSubscriptionPeer.RECIPIENT_ID,
1003            CustomerPeer.CUSTOMER_ID);
1004        
1005
1006                                                                                                                                                                                                                                                                                                                                                                                                  
1007        List JavaDoc rows = BasePeer.doSelect(criteria);
1008        List JavaDoc results = new ArrayList JavaDoc();
1009
1010        for (int i = 0; i < rows.size(); i++)
1011        {
1012            Record row = (Record) rows.get(i);
1013
1014                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1015                    PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer
1016                .row2Object(row, 1, omClass);
1017                     omClass = CustomerPeer.getOMClass();
1018                    Customer obj2 = (Customer)CustomerPeer
1019                .row2Object(row, offset, omClass);
1020
1021            boolean newObject = true;
1022            for (int j = 0; j < results.size(); j++)
1023            {
1024                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1025                Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByRecipientId();
1026                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1027                {
1028                    newObject = false;
1029                              temp_obj2.addPrintSubscriptionRelatedByRecipientId(obj1);
1030                              break;
1031                }
1032            }
1033                      if (newObject)
1034            {
1035                obj2.initPrintSubscriptionsRelatedByRecipientId();
1036                obj2.addPrintSubscriptionRelatedByRecipientId(obj1);
1037            }
1038                      results.add(obj1);
1039        }
1040        return results;
1041    }
1042                                                            
1043                
1044                
1045
1046    /**
1047     * selects a collection of PrintSubscription objects pre-filled with their
1048     * Carrier objects.
1049     *
1050     * This method is protected by default in order to keep the public
1051     * api reasonable. You can provide public methods for those you
1052     * actually need in PrintSubscriptionPeer.
1053     *
1054     * @throws TorqueException Any exceptions caught during processing will be
1055     * rethrown wrapped into a TorqueException.
1056     */

1057    protected static List JavaDoc doSelectJoinCarrier(Criteria criteria)
1058        throws TorqueException
1059    {
1060        setDbName(criteria);
1061
1062        PrintSubscriptionPeer.addSelectColumns(criteria);
1063        int offset = numColumns + 1;
1064        CarrierPeer.addSelectColumns(criteria);
1065
1066
1067                        criteria.addJoin(PrintSubscriptionPeer.CARRIER_ID,
1068            CarrierPeer.CARRIER_ID);
1069        
1070
1071                                                                                                                                                                                                                                                                                                                                                                                                  
1072        List JavaDoc rows = BasePeer.doSelect(criteria);
1073        List JavaDoc results = new ArrayList JavaDoc();
1074
1075        for (int i = 0; i < rows.size(); i++)
1076        {
1077            Record row = (Record) rows.get(i);
1078
1079                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1080                    PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer
1081                .row2Object(row, 1, omClass);
1082                     omClass = CarrierPeer.getOMClass();
1083                    Carrier obj2 = (Carrier)CarrierPeer
1084                .row2Object(row, offset, omClass);
1085
1086            boolean newObject = true;
1087            for (int j = 0; j < results.size(); j++)
1088            {
1089                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1090                Carrier temp_obj2 = (Carrier)temp_obj1.getCarrier();
1091                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1092                {
1093                    newObject = false;
1094                              temp_obj2.addPrintSubscription(obj1);
1095                              break;
1096                }
1097            }
1098                      if (newObject)
1099            {
1100                obj2.initPrintSubscriptions();
1101                obj2.addPrintSubscription(obj1);
1102            }
1103                      results.add(obj1);
1104        }
1105        return results;
1106    }
1107                                                            
1108                
1109                
1110
1111    /**
1112     * selects a collection of PrintSubscription objects pre-filled with their
1113     * Project objects.
1114     *
1115     * This method is protected by default in order to keep the public
1116     * api reasonable. You can provide public methods for those you
1117     * actually need in PrintSubscriptionPeer.
1118     *
1119     * @throws TorqueException Any exceptions caught during processing will be
1120     * rethrown wrapped into a TorqueException.
1121     */

1122    protected static List JavaDoc doSelectJoinProject(Criteria criteria)
1123        throws TorqueException
1124    {
1125        setDbName(criteria);
1126
1127        PrintSubscriptionPeer.addSelectColumns(criteria);
1128        int offset = numColumns + 1;
1129        ProjectPeer.addSelectColumns(criteria);
1130
1131
1132                        criteria.addJoin(PrintSubscriptionPeer.PROJECT_ID,
1133            ProjectPeer.PROJECT_ID);
1134        
1135
1136                                                                                                                                                                                                                                                                                                                                                                                                  
1137        List JavaDoc rows = BasePeer.doSelect(criteria);
1138        List JavaDoc results = new ArrayList JavaDoc();
1139
1140        for (int i = 0; i < rows.size(); i++)
1141        {
1142            Record row = (Record) rows.get(i);
1143
1144                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1145                    PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer
1146                .row2Object(row, 1, omClass);
1147                     omClass = ProjectPeer.getOMClass();
1148                    Project obj2 = (Project)ProjectPeer
1149                .row2Object(row, offset, omClass);
1150
1151            boolean newObject = true;
1152            for (int j = 0; j < results.size(); j++)
1153            {
1154                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1155                Project temp_obj2 = (Project)temp_obj1.getProject();
1156                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1157                {
1158                    newObject = false;
1159                              temp_obj2.addPrintSubscription(obj1);
1160                              break;
1161                }
1162            }
1163                      if (newObject)
1164            {
1165                obj2.initPrintSubscriptions();
1166                obj2.addPrintSubscription(obj1);
1167            }
1168                      results.add(obj1);
1169        }
1170        return results;
1171    }
1172                                                            
1173                
1174                
1175
1176    /**
1177     * selects a collection of PrintSubscription objects pre-filled with their
1178     * Product objects.
1179     *
1180     * This method is protected by default in order to keep the public
1181     * api reasonable. You can provide public methods for those you
1182     * actually need in PrintSubscriptionPeer.
1183     *
1184     * @throws TorqueException Any exceptions caught during processing will be
1185     * rethrown wrapped into a TorqueException.
1186     */

1187    protected static List JavaDoc doSelectJoinProduct(Criteria criteria)
1188        throws TorqueException
1189    {
1190        setDbName(criteria);
1191
1192        PrintSubscriptionPeer.addSelectColumns(criteria);
1193        int offset = numColumns + 1;
1194        ProductPeer.addSelectColumns(criteria);
1195
1196
1197                        criteria.addJoin(PrintSubscriptionPeer.PRODUCT_ID,
1198            ProductPeer.PRODUCT_ID);
1199        
1200
1201                                                                                                                                                                                                                                                                                                                                                                                                  
1202        List JavaDoc rows = BasePeer.doSelect(criteria);
1203        List JavaDoc results = new ArrayList JavaDoc();
1204
1205        for (int i = 0; i < rows.size(); i++)
1206        {
1207            Record row = (Record) rows.get(i);
1208
1209                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1210                    PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer
1211                .row2Object(row, 1, omClass);
1212                     omClass = ProductPeer.getOMClass();
1213                    Product obj2 = (Product)ProductPeer
1214                .row2Object(row, offset, omClass);
1215
1216            boolean newObject = true;
1217            for (int j = 0; j < results.size(); j++)
1218            {
1219                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1220                Product temp_obj2 = (Product)temp_obj1.getProduct();
1221                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1222                {
1223                    newObject = false;
1224                              temp_obj2.addPrintSubscription(obj1);
1225                              break;
1226                }
1227            }
1228                      if (newObject)
1229            {
1230                obj2.initPrintSubscriptions();
1231                obj2.addPrintSubscription(obj1);
1232            }
1233                      results.add(obj1);
1234        }
1235        return results;
1236    }
1237                                                            
1238                
1239                
1240
1241    /**
1242     * selects a collection of PrintSubscription objects pre-filled with their
1243     * Sorder objects.
1244     *
1245     * This method is protected by default in order to keep the public
1246     * api reasonable. You can provide public methods for those you
1247     * actually need in PrintSubscriptionPeer.
1248     *
1249     * @throws TorqueException Any exceptions caught during processing will be
1250     * rethrown wrapped into a TorqueException.
1251     */

1252    protected static List JavaDoc doSelectJoinSorder(Criteria criteria)
1253        throws TorqueException
1254    {
1255        setDbName(criteria);
1256
1257        PrintSubscriptionPeer.addSelectColumns(criteria);
1258        int offset = numColumns + 1;
1259        SorderPeer.addSelectColumns(criteria);
1260
1261
1262                        criteria.addJoin(PrintSubscriptionPeer.SORDER_ID,
1263            SorderPeer.SORDER_ID);
1264        
1265
1266                                                                                                                                                                                                                                                                                                                                                                                                  
1267        List JavaDoc rows = BasePeer.doSelect(criteria);
1268        List JavaDoc results = new ArrayList JavaDoc();
1269
1270        for (int i = 0; i < rows.size(); i++)
1271        {
1272            Record row = (Record) rows.get(i);
1273
1274                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1275                    PrintSubscription obj1 = (PrintSubscription) PrintSubscriptionPeer
1276                .row2Object(row, 1, omClass);
1277                     omClass = SorderPeer.getOMClass();
1278                    Sorder obj2 = (Sorder)SorderPeer
1279                .row2Object(row, offset, omClass);
1280
1281            boolean newObject = true;
1282            for (int j = 0; j < results.size(); j++)
1283            {
1284                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1285                Sorder temp_obj2 = (Sorder)temp_obj1.getSorder();
1286                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1287                {
1288                    newObject = false;
1289                              temp_obj2.addPrintSubscription(obj1);
1290                              break;
1291                }
1292            }
1293                      if (newObject)
1294            {
1295                obj2.initPrintSubscriptions();
1296                obj2.addPrintSubscription(obj1);
1297            }
1298                      results.add(obj1);
1299        }
1300        return results;
1301    }
1302                    
1303  
1304                                                                  
1305          
1306        
1307                                            
1308                
1309
1310    /**
1311     * selects a collection of PrintSubscription objects pre-filled with
1312     * all related objects.
1313     *
1314     * This method is protected by default in order to keep the public
1315     * api reasonable. You can provide public methods for those you
1316     * actually need in PrintSubscriptionPeer.
1317     *
1318     * @throws TorqueException Any exceptions caught during processing will be
1319     * rethrown wrapped into a TorqueException.
1320     */

1321    protected static List JavaDoc doSelectJoinAllExceptCustomerRelatedByCustomerId(Criteria criteria)
1322        throws TorqueException
1323    {
1324        setDbName(criteria);
1325
1326        addSelectColumns(criteria);
1327        int offset2 = numColumns + 1;
1328                                    
1329                                                  
1330                                                  
1331                    CarrierPeer.addSelectColumns(criteria);
1332        int offset3 = offset2 + CarrierPeer.numColumns;
1333                                                                
1334                    ProjectPeer.addSelectColumns(criteria);
1335        int offset4 = offset3 + ProjectPeer.numColumns;
1336                                                                
1337                    ProductPeer.addSelectColumns(criteria);
1338        int offset5 = offset4 + ProductPeer.numColumns;
1339                                                                
1340                    SorderPeer.addSelectColumns(criteria);
1341        int offset6 = offset5 + SorderPeer.numColumns;
1342                                                                                                                                                                                                                                                                                                                                                                                                                                              
1343        List JavaDoc rows = BasePeer.doSelect(criteria);
1344        List JavaDoc results = new ArrayList JavaDoc();
1345
1346        for (int i = 0; i < rows.size(); i++)
1347        {
1348            Record row = (Record)rows.get(i);
1349
1350                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1351                    PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer
1352                .row2Object(row, 1, omClass);
1353                                                
1354                                                                  
1355                                                                  
1356                                                        
1357                            
1358              
1359                           omClass = CarrierPeer.getOMClass();
1360                          Carrier obj2 = (Carrier)CarrierPeer
1361                .row2Object( row, offset2, omClass);
1362
1363               boolean newObject = true;
1364            for (int j = 0; j < results.size(); j++)
1365            {
1366                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1367                Carrier temp_obj2 = (Carrier)temp_obj1.getCarrier();
1368                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1369                {
1370                    newObject = false;
1371                                    temp_obj2.addPrintSubscription(obj1);
1372                                    break;
1373                }
1374            }
1375                            if (newObject)
1376            {
1377                obj2.initPrintSubscriptions();
1378                obj2.addPrintSubscription(obj1);
1379            }
1380                                                                                    
1381                                                        
1382                            
1383              
1384                           omClass = ProjectPeer.getOMClass();
1385                          Project obj3 = (Project)ProjectPeer
1386                .row2Object( row, offset3, omClass);
1387
1388               newObject = true;
1389            for (int j = 0; j < results.size(); j++)
1390            {
1391                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1392                Project temp_obj3 = (Project)temp_obj1.getProject();
1393                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1394                {
1395                    newObject = false;
1396                                    temp_obj3.addPrintSubscription(obj1);
1397                                    break;
1398                }
1399            }
1400                            if (newObject)
1401            {
1402                obj3.initPrintSubscriptions();
1403                obj3.addPrintSubscription(obj1);
1404            }
1405                                                                                    
1406                                                        
1407                            
1408              
1409                           omClass = ProductPeer.getOMClass();
1410                          Product obj4 = (Product)ProductPeer
1411                .row2Object( row, offset4, omClass);
1412
1413               newObject = true;
1414            for (int j = 0; j < results.size(); j++)
1415            {
1416                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1417                Product temp_obj4 = (Product)temp_obj1.getProduct();
1418                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1419                {
1420                    newObject = false;
1421                                    temp_obj4.addPrintSubscription(obj1);
1422                                    break;
1423                }
1424            }
1425                            if (newObject)
1426            {
1427                obj4.initPrintSubscriptions();
1428                obj4.addPrintSubscription(obj1);
1429            }
1430                                                                                    
1431                                                        
1432                            
1433              
1434                           omClass = SorderPeer.getOMClass();
1435                          Sorder obj5 = (Sorder)SorderPeer
1436                .row2Object( row, offset5, omClass);
1437
1438               newObject = true;
1439            for (int j = 0; j < results.size(); j++)
1440            {
1441                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1442                Sorder temp_obj5 = (Sorder)temp_obj1.getSorder();
1443                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1444                {
1445                    newObject = false;
1446                                    temp_obj5.addPrintSubscription(obj1);
1447                                    break;
1448                }
1449            }
1450                            if (newObject)
1451            {
1452                obj5.initPrintSubscriptions();
1453                obj5.addPrintSubscription(obj1);
1454            }
1455                                                                results.add(obj1);
1456        }
1457        return results;
1458    }
1459        
1460        
1461                                            
1462                
1463
1464    /**
1465     * selects a collection of PrintSubscription objects pre-filled with
1466     * all related objects.
1467     *
1468     * This method is protected by default in order to keep the public
1469     * api reasonable. You can provide public methods for those you
1470     * actually need in PrintSubscriptionPeer.
1471     *
1472     * @throws TorqueException Any exceptions caught during processing will be
1473     * rethrown wrapped into a TorqueException.
1474     */

1475    protected static List JavaDoc doSelectJoinAllExceptCustomerRelatedByRecipientId(Criteria criteria)
1476        throws TorqueException
1477    {
1478        setDbName(criteria);
1479
1480        addSelectColumns(criteria);
1481        int offset2 = numColumns + 1;
1482                                    
1483                                                  
1484                                                  
1485                    CarrierPeer.addSelectColumns(criteria);
1486        int offset3 = offset2 + CarrierPeer.numColumns;
1487                                                                
1488                    ProjectPeer.addSelectColumns(criteria);
1489        int offset4 = offset3 + ProjectPeer.numColumns;
1490                                                                
1491                    ProductPeer.addSelectColumns(criteria);
1492        int offset5 = offset4 + ProductPeer.numColumns;
1493                                                                
1494                    SorderPeer.addSelectColumns(criteria);
1495        int offset6 = offset5 + SorderPeer.numColumns;
1496                                                                                                                                                                                                                                                                                                                                                                                                                                              
1497        List JavaDoc rows = BasePeer.doSelect(criteria);
1498        List JavaDoc results = new ArrayList JavaDoc();
1499
1500        for (int i = 0; i < rows.size(); i++)
1501        {
1502            Record row = (Record)rows.get(i);
1503
1504                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1505                    PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer
1506                .row2Object(row, 1, omClass);
1507                                                
1508                                                                  
1509                                                                  
1510                                                        
1511                            
1512              
1513                           omClass = CarrierPeer.getOMClass();
1514                          Carrier obj2 = (Carrier)CarrierPeer
1515                .row2Object( row, offset2, omClass);
1516
1517               boolean newObject = true;
1518            for (int j = 0; j < results.size(); j++)
1519            {
1520                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1521                Carrier temp_obj2 = (Carrier)temp_obj1.getCarrier();
1522                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1523                {
1524                    newObject = false;
1525                                    temp_obj2.addPrintSubscription(obj1);
1526                                    break;
1527                }
1528            }
1529                            if (newObject)
1530            {
1531                obj2.initPrintSubscriptions();
1532                obj2.addPrintSubscription(obj1);
1533            }
1534                                                                                    
1535                                                        
1536                            
1537              
1538                           omClass = ProjectPeer.getOMClass();
1539                          Project obj3 = (Project)ProjectPeer
1540                .row2Object( row, offset3, omClass);
1541
1542               newObject = true;
1543            for (int j = 0; j < results.size(); j++)
1544            {
1545                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1546                Project temp_obj3 = (Project)temp_obj1.getProject();
1547                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1548                {
1549                    newObject = false;
1550                                    temp_obj3.addPrintSubscription(obj1);
1551                                    break;
1552                }
1553            }
1554                            if (newObject)
1555            {
1556                obj3.initPrintSubscriptions();
1557                obj3.addPrintSubscription(obj1);
1558            }
1559                                                                                    
1560                                                        
1561                            
1562              
1563                           omClass = ProductPeer.getOMClass();
1564                          Product obj4 = (Product)ProductPeer
1565                .row2Object( row, offset4, omClass);
1566
1567               newObject = true;
1568            for (int j = 0; j < results.size(); j++)
1569            {
1570                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1571                Product temp_obj4 = (Product)temp_obj1.getProduct();
1572                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1573                {
1574                    newObject = false;
1575                                    temp_obj4.addPrintSubscription(obj1);
1576                                    break;
1577                }
1578            }
1579                            if (newObject)
1580            {
1581                obj4.initPrintSubscriptions();
1582                obj4.addPrintSubscription(obj1);
1583            }
1584                                                                                    
1585                                                        
1586                            
1587              
1588                           omClass = SorderPeer.getOMClass();
1589                          Sorder obj5 = (Sorder)SorderPeer
1590                .row2Object( row, offset5, omClass);
1591
1592               newObject = true;
1593            for (int j = 0; j < results.size(); j++)
1594            {
1595                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1596                Sorder temp_obj5 = (Sorder)temp_obj1.getSorder();
1597                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1598                {
1599                    newObject = false;
1600                                    temp_obj5.addPrintSubscription(obj1);
1601                                    break;
1602                }
1603            }
1604                            if (newObject)
1605            {
1606                obj5.initPrintSubscriptions();
1607                obj5.addPrintSubscription(obj1);
1608            }
1609                                                                results.add(obj1);
1610        }
1611        return results;
1612    }
1613        
1614        
1615                                  
1616                
1617
1618    /**
1619     * selects a collection of PrintSubscription objects pre-filled with
1620     * all related objects.
1621     *
1622     * This method is protected by default in order to keep the public
1623     * api reasonable. You can provide public methods for those you
1624     * actually need in PrintSubscriptionPeer.
1625     *
1626     * @throws TorqueException Any exceptions caught during processing will be
1627     * rethrown wrapped into a TorqueException.
1628     */

1629    protected static List JavaDoc doSelectJoinAllExceptCarrier(Criteria criteria)
1630        throws TorqueException
1631    {
1632        setDbName(criteria);
1633
1634        addSelectColumns(criteria);
1635        int offset2 = numColumns + 1;
1636                                    
1637                    CustomerPeer.addSelectColumns(criteria);
1638        int offset3 = offset2 + CustomerPeer.numColumns;
1639                                                                
1640                    CustomerPeer.addSelectColumns(criteria);
1641        int offset4 = offset3 + CustomerPeer.numColumns;
1642                                                                
1643                                                  
1644                    ProjectPeer.addSelectColumns(criteria);
1645        int offset5 = offset4 + ProjectPeer.numColumns;
1646                                                                
1647                    ProductPeer.addSelectColumns(criteria);
1648        int offset6 = offset5 + ProductPeer.numColumns;
1649                                                                
1650                    SorderPeer.addSelectColumns(criteria);
1651        int offset7 = offset6 + SorderPeer.numColumns;
1652                                                                                                                                                                                                                                                                                                                                                                                                                                              
1653        List JavaDoc rows = BasePeer.doSelect(criteria);
1654        List JavaDoc results = new ArrayList JavaDoc();
1655
1656        for (int i = 0; i < rows.size(); i++)
1657        {
1658            Record row = (Record)rows.get(i);
1659
1660                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1661                    PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer
1662                .row2Object(row, 1, omClass);
1663                                                
1664                                                                        
1665                            
1666              
1667                           omClass = CustomerPeer.getOMClass();
1668                          Customer obj2 = (Customer)CustomerPeer
1669                .row2Object( row, offset2, omClass);
1670
1671               boolean newObject = true;
1672            for (int j = 0; j < results.size(); j++)
1673            {
1674                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1675                Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId();
1676                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1677                {
1678                    newObject = false;
1679                                    temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
1680                                    break;
1681                }
1682            }
1683                            if (newObject)
1684            {
1685                obj2.initPrintSubscriptionsRelatedByCustomerId();
1686                obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
1687            }
1688                                                                                    
1689                                                                        
1690                            
1691              
1692                           omClass = CustomerPeer.getOMClass();
1693                          Customer obj3 = (Customer)CustomerPeer
1694                .row2Object( row, offset3, omClass);
1695
1696               newObject = true;
1697            for (int j = 0; j < results.size(); j++)
1698            {
1699                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1700                Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId();
1701                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1702                {
1703                    newObject = false;
1704                                    temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
1705                                    break;
1706                }
1707            }
1708                            if (newObject)
1709            {
1710                obj3.initPrintSubscriptionsRelatedByRecipientId();
1711                obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
1712            }
1713                                                                                    
1714                                                                  
1715                                                        
1716                            
1717              
1718                           omClass = ProjectPeer.getOMClass();
1719                          Project obj4 = (Project)ProjectPeer
1720                .row2Object( row, offset4, omClass);
1721
1722               newObject = true;
1723            for (int j = 0; j < results.size(); j++)
1724            {
1725                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1726                Project temp_obj4 = (Project)temp_obj1.getProject();
1727                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1728                {
1729                    newObject = false;
1730                                    temp_obj4.addPrintSubscription(obj1);
1731                                    break;
1732                }
1733            }
1734                            if (newObject)
1735            {
1736                obj4.initPrintSubscriptions();
1737                obj4.addPrintSubscription(obj1);
1738            }
1739                                                                                    
1740                                                        
1741                            
1742              
1743                           omClass = ProductPeer.getOMClass();
1744                          Product obj5 = (Product)ProductPeer
1745                .row2Object( row, offset5, omClass);
1746
1747               newObject = true;
1748            for (int j = 0; j < results.size(); j++)
1749            {
1750                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1751                Product temp_obj5 = (Product)temp_obj1.getProduct();
1752                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1753                {
1754                    newObject = false;
1755                                    temp_obj5.addPrintSubscription(obj1);
1756                                    break;
1757                }
1758            }
1759                            if (newObject)
1760            {
1761                obj5.initPrintSubscriptions();
1762                obj5.addPrintSubscription(obj1);
1763            }
1764                                                                                    
1765                                                        
1766                            
1767              
1768                           omClass = SorderPeer.getOMClass();
1769                          Sorder obj6 = (Sorder)SorderPeer
1770                .row2Object( row, offset6, omClass);
1771
1772               newObject = true;
1773            for (int j = 0; j < results.size(); j++)
1774            {
1775                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1776                Sorder temp_obj6 = (Sorder)temp_obj1.getSorder();
1777                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
1778                {
1779                    newObject = false;
1780                                    temp_obj6.addPrintSubscription(obj1);
1781                                    break;
1782                }
1783            }
1784                            if (newObject)
1785            {
1786                obj6.initPrintSubscriptions();
1787                obj6.addPrintSubscription(obj1);
1788            }
1789                                                                results.add(obj1);
1790        }
1791        return results;
1792    }
1793        
1794        
1795                                  
1796                
1797
1798    /**
1799     * selects a collection of PrintSubscription objects pre-filled with
1800     * all related objects.
1801     *
1802     * This method is protected by default in order to keep the public
1803     * api reasonable. You can provide public methods for those you
1804     * actually need in PrintSubscriptionPeer.
1805     *
1806     * @throws TorqueException Any exceptions caught during processing will be
1807     * rethrown wrapped into a TorqueException.
1808     */

1809    protected static List JavaDoc doSelectJoinAllExceptProject(Criteria criteria)
1810        throws TorqueException
1811    {
1812        setDbName(criteria);
1813
1814        addSelectColumns(criteria);
1815        int offset2 = numColumns + 1;
1816                                    
1817                    CustomerPeer.addSelectColumns(criteria);
1818        int offset3 = offset2 + CustomerPeer.numColumns;
1819                                                                
1820                    CustomerPeer.addSelectColumns(criteria);
1821        int offset4 = offset3 + CustomerPeer.numColumns;
1822                                                                
1823                    CarrierPeer.addSelectColumns(criteria);
1824        int offset5 = offset4 + CarrierPeer.numColumns;
1825                                                                
1826                                                  
1827                    ProductPeer.addSelectColumns(criteria);
1828        int offset6 = offset5 + ProductPeer.numColumns;
1829                                                                
1830                    SorderPeer.addSelectColumns(criteria);
1831        int offset7 = offset6 + SorderPeer.numColumns;
1832                                                                                                                                                                                                                                                                                                                                                                                                                                              
1833        List JavaDoc rows = BasePeer.doSelect(criteria);
1834        List JavaDoc results = new ArrayList JavaDoc();
1835
1836        for (int i = 0; i < rows.size(); i++)
1837        {
1838            Record row = (Record)rows.get(i);
1839
1840                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
1841                    PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer
1842                .row2Object(row, 1, omClass);
1843                                                
1844                                                                        
1845                            
1846              
1847                           omClass = CustomerPeer.getOMClass();
1848                          Customer obj2 = (Customer)CustomerPeer
1849                .row2Object( row, offset2, omClass);
1850
1851               boolean newObject = true;
1852            for (int j = 0; j < results.size(); j++)
1853            {
1854                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1855                Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId();
1856                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1857                {
1858                    newObject = false;
1859                                    temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
1860                                    break;
1861                }
1862            }
1863                            if (newObject)
1864            {
1865                obj2.initPrintSubscriptionsRelatedByCustomerId();
1866                obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
1867            }
1868                                                                                    
1869                                                                        
1870                            
1871              
1872                           omClass = CustomerPeer.getOMClass();
1873                          Customer obj3 = (Customer)CustomerPeer
1874                .row2Object( row, offset3, omClass);
1875
1876               newObject = true;
1877            for (int j = 0; j < results.size(); j++)
1878            {
1879                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1880                Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId();
1881                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1882                {
1883                    newObject = false;
1884                                    temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
1885                                    break;
1886                }
1887            }
1888                            if (newObject)
1889            {
1890                obj3.initPrintSubscriptionsRelatedByRecipientId();
1891                obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
1892            }
1893                                                                                    
1894                                                        
1895                            
1896              
1897                           omClass = CarrierPeer.getOMClass();
1898                          Carrier obj4 = (Carrier)CarrierPeer
1899                .row2Object( row, offset4, omClass);
1900
1901               newObject = true;
1902            for (int j = 0; j < results.size(); j++)
1903            {
1904                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1905                Carrier temp_obj4 = (Carrier)temp_obj1.getCarrier();
1906                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
1907                {
1908                    newObject = false;
1909                                    temp_obj4.addPrintSubscription(obj1);
1910                                    break;
1911                }
1912            }
1913                            if (newObject)
1914            {
1915                obj4.initPrintSubscriptions();
1916                obj4.addPrintSubscription(obj1);
1917            }
1918                                                                                    
1919                                                                  
1920                                                        
1921                            
1922              
1923                           omClass = ProductPeer.getOMClass();
1924                          Product obj5 = (Product)ProductPeer
1925                .row2Object( row, offset5, omClass);
1926
1927               newObject = true;
1928            for (int j = 0; j < results.size(); j++)
1929            {
1930                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1931                Product temp_obj5 = (Product)temp_obj1.getProduct();
1932                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
1933                {
1934                    newObject = false;
1935                                    temp_obj5.addPrintSubscription(obj1);
1936                                    break;
1937                }
1938            }
1939                            if (newObject)
1940            {
1941                obj5.initPrintSubscriptions();
1942                obj5.addPrintSubscription(obj1);
1943            }
1944                                                                                    
1945                                                        
1946                            
1947              
1948                           omClass = SorderPeer.getOMClass();
1949                          Sorder obj6 = (Sorder)SorderPeer
1950                .row2Object( row, offset6, omClass);
1951
1952               newObject = true;
1953            for (int j = 0; j < results.size(); j++)
1954            {
1955                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
1956                Sorder temp_obj6 = (Sorder)temp_obj1.getSorder();
1957                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
1958                {
1959                    newObject = false;
1960                                    temp_obj6.addPrintSubscription(obj1);
1961                                    break;
1962                }
1963            }
1964                            if (newObject)
1965            {
1966                obj6.initPrintSubscriptions();
1967                obj6.addPrintSubscription(obj1);
1968            }
1969                                                                results.add(obj1);
1970        }
1971        return results;
1972    }
1973        
1974        
1975                                  
1976                
1977
1978    /**
1979     * selects a collection of PrintSubscription objects pre-filled with
1980     * all related objects.
1981     *
1982     * This method is protected by default in order to keep the public
1983     * api reasonable. You can provide public methods for those you
1984     * actually need in PrintSubscriptionPeer.
1985     *
1986     * @throws TorqueException Any exceptions caught during processing will be
1987     * rethrown wrapped into a TorqueException.
1988     */

1989    protected static List JavaDoc doSelectJoinAllExceptProduct(Criteria criteria)
1990        throws TorqueException
1991    {
1992        setDbName(criteria);
1993
1994        addSelectColumns(criteria);
1995        int offset2 = numColumns + 1;
1996                                    
1997                    CustomerPeer.addSelectColumns(criteria);
1998        int offset3 = offset2 + CustomerPeer.numColumns;
1999                                                                
2000                    CustomerPeer.addSelectColumns(criteria);
2001        int offset4 = offset3 + CustomerPeer.numColumns;
2002                                                                
2003                    CarrierPeer.addSelectColumns(criteria);
2004        int offset5 = offset4 + CarrierPeer.numColumns;
2005                                                                
2006                    ProjectPeer.addSelectColumns(criteria);
2007        int offset6 = offset5 + ProjectPeer.numColumns;
2008                                                                
2009                                                  
2010                    SorderPeer.addSelectColumns(criteria);
2011        int offset7 = offset6 + SorderPeer.numColumns;
2012                                                                                                                                                                                                                                                                                                                                                                                                                                              
2013        List JavaDoc rows = BasePeer.doSelect(criteria);
2014        List JavaDoc results = new ArrayList JavaDoc();
2015
2016        for (int i = 0; i < rows.size(); i++)
2017        {
2018            Record row = (Record)rows.get(i);
2019
2020                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
2021                    PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer
2022                .row2Object(row, 1, omClass);
2023                                                
2024                                                                        
2025                            
2026              
2027                           omClass = CustomerPeer.getOMClass();
2028                          Customer obj2 = (Customer)CustomerPeer
2029                .row2Object( row, offset2, omClass);
2030
2031               boolean newObject = true;
2032            for (int j = 0; j < results.size(); j++)
2033            {
2034                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2035                Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId();
2036                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2037                {
2038                    newObject = false;
2039                                    temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
2040                                    break;
2041                }
2042            }
2043                            if (newObject)
2044            {
2045                obj2.initPrintSubscriptionsRelatedByCustomerId();
2046                obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
2047            }
2048                                                                                    
2049                                                                        
2050                            
2051              
2052                           omClass = CustomerPeer.getOMClass();
2053                          Customer obj3 = (Customer)CustomerPeer
2054                .row2Object( row, offset3, omClass);
2055
2056               newObject = true;
2057            for (int j = 0; j < results.size(); j++)
2058            {
2059                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2060                Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId();
2061                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2062                {
2063                    newObject = false;
2064                                    temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
2065                                    break;
2066                }
2067            }
2068                            if (newObject)
2069            {
2070                obj3.initPrintSubscriptionsRelatedByRecipientId();
2071                obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
2072            }
2073                                                                                    
2074                                                        
2075                            
2076              
2077                           omClass = CarrierPeer.getOMClass();
2078                          Carrier obj4 = (Carrier)CarrierPeer
2079                .row2Object( row, offset4, omClass);
2080
2081               newObject = true;
2082            for (int j = 0; j < results.size(); j++)
2083            {
2084                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2085                Carrier temp_obj4 = (Carrier)temp_obj1.getCarrier();
2086                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2087                {
2088                    newObject = false;
2089                                    temp_obj4.addPrintSubscription(obj1);
2090                                    break;
2091                }
2092            }
2093                            if (newObject)
2094            {
2095                obj4.initPrintSubscriptions();
2096                obj4.addPrintSubscription(obj1);
2097            }
2098                                                                                    
2099                                                        
2100                            
2101              
2102                           omClass = ProjectPeer.getOMClass();
2103                          Project obj5 = (Project)ProjectPeer
2104                .row2Object( row, offset5, omClass);
2105
2106               newObject = true;
2107            for (int j = 0; j < results.size(); j++)
2108            {
2109                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2110                Project temp_obj5 = (Project)temp_obj1.getProject();
2111                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2112                {
2113                    newObject = false;
2114                                    temp_obj5.addPrintSubscription(obj1);
2115                                    break;
2116                }
2117            }
2118                            if (newObject)
2119            {
2120                obj5.initPrintSubscriptions();
2121                obj5.addPrintSubscription(obj1);
2122            }
2123                                                                                    
2124                                                                  
2125                                                        
2126                            
2127              
2128                           omClass = SorderPeer.getOMClass();
2129                          Sorder obj6 = (Sorder)SorderPeer
2130                .row2Object( row, offset6, omClass);
2131
2132               newObject = true;
2133            for (int j = 0; j < results.size(); j++)
2134            {
2135                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2136                Sorder temp_obj6 = (Sorder)temp_obj1.getSorder();
2137                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2138                {
2139                    newObject = false;
2140                                    temp_obj6.addPrintSubscription(obj1);
2141                                    break;
2142                }
2143            }
2144                            if (newObject)
2145            {
2146                obj6.initPrintSubscriptions();
2147                obj6.addPrintSubscription(obj1);
2148            }
2149                                                                results.add(obj1);
2150        }
2151        return results;
2152    }
2153        
2154        
2155                                  
2156                
2157
2158    /**
2159     * selects a collection of PrintSubscription objects pre-filled with
2160     * all related objects.
2161     *
2162     * This method is protected by default in order to keep the public
2163     * api reasonable. You can provide public methods for those you
2164     * actually need in PrintSubscriptionPeer.
2165     *
2166     * @throws TorqueException Any exceptions caught during processing will be
2167     * rethrown wrapped into a TorqueException.
2168     */

2169    protected static List JavaDoc doSelectJoinAllExceptSorder(Criteria criteria)
2170        throws TorqueException
2171    {
2172        setDbName(criteria);
2173
2174        addSelectColumns(criteria);
2175        int offset2 = numColumns + 1;
2176                                    
2177                    CustomerPeer.addSelectColumns(criteria);
2178        int offset3 = offset2 + CustomerPeer.numColumns;
2179                                                                
2180                    CustomerPeer.addSelectColumns(criteria);
2181        int offset4 = offset3 + CustomerPeer.numColumns;
2182                                                                
2183                    CarrierPeer.addSelectColumns(criteria);
2184        int offset5 = offset4 + CarrierPeer.numColumns;
2185                                                                
2186                    ProjectPeer.addSelectColumns(criteria);
2187        int offset6 = offset5 + ProjectPeer.numColumns;
2188                                                                
2189                    ProductPeer.addSelectColumns(criteria);
2190        int offset7 = offset6 + ProductPeer.numColumns;
2191                                                                
2192                                                                                                                                                                                                                                                                                                                                                                                                                                
2193        List JavaDoc rows = BasePeer.doSelect(criteria);
2194        List JavaDoc results = new ArrayList JavaDoc();
2195
2196        for (int i = 0; i < rows.size(); i++)
2197        {
2198            Record row = (Record)rows.get(i);
2199
2200                            Class JavaDoc omClass = PrintSubscriptionPeer.getOMClass();
2201                    PrintSubscription obj1 = (PrintSubscription)PrintSubscriptionPeer
2202                .row2Object(row, 1, omClass);
2203                                                
2204                                                                        
2205                            
2206              
2207                           omClass = CustomerPeer.getOMClass();
2208                          Customer obj2 = (Customer)CustomerPeer
2209                .row2Object( row, offset2, omClass);
2210
2211               boolean newObject = true;
2212            for (int j = 0; j < results.size(); j++)
2213            {
2214                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2215                Customer temp_obj2 = (Customer)temp_obj1.getCustomerRelatedByCustomerId();
2216                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
2217                {
2218                    newObject = false;
2219                                    temp_obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
2220                                    break;
2221                }
2222            }
2223                            if (newObject)
2224            {
2225                obj2.initPrintSubscriptionsRelatedByCustomerId();
2226                obj2.addPrintSubscriptionRelatedByCustomerId(obj1);
2227            }
2228                                                                                    
2229                                                                        
2230                            
2231              
2232                           omClass = CustomerPeer.getOMClass();
2233                          Customer obj3 = (Customer)CustomerPeer
2234                .row2Object( row, offset3, omClass);
2235
2236               newObject = true;
2237            for (int j = 0; j < results.size(); j++)
2238            {
2239                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2240                Customer temp_obj3 = (Customer)temp_obj1.getCustomerRelatedByRecipientId();
2241                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
2242                {
2243                    newObject = false;
2244                                    temp_obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
2245                                    break;
2246                }
2247            }
2248                            if (newObject)
2249            {
2250                obj3.initPrintSubscriptionsRelatedByRecipientId();
2251                obj3.addPrintSubscriptionRelatedByRecipientId(obj1);
2252            }
2253                                                                                    
2254                                                        
2255                            
2256              
2257                           omClass = CarrierPeer.getOMClass();
2258                          Carrier obj4 = (Carrier)CarrierPeer
2259                .row2Object( row, offset4, omClass);
2260
2261               newObject = true;
2262            for (int j = 0; j < results.size(); j++)
2263            {
2264                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2265                Carrier temp_obj4 = (Carrier)temp_obj1.getCarrier();
2266                if (temp_obj4.getPrimaryKey().equals(obj4.getPrimaryKey()))
2267                {
2268                    newObject = false;
2269                                    temp_obj4.addPrintSubscription(obj1);
2270                                    break;
2271                }
2272            }
2273                            if (newObject)
2274            {
2275                obj4.initPrintSubscriptions();
2276                obj4.addPrintSubscription(obj1);
2277            }
2278                                                                                    
2279                                                        
2280                            
2281              
2282                           omClass = ProjectPeer.getOMClass();
2283                          Project obj5 = (Project)ProjectPeer
2284                .row2Object( row, offset5, omClass);
2285
2286               newObject = true;
2287            for (int j = 0; j < results.size(); j++)
2288            {
2289                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2290                Project temp_obj5 = (Project)temp_obj1.getProject();
2291                if (temp_obj5.getPrimaryKey().equals(obj5.getPrimaryKey()))
2292                {
2293                    newObject = false;
2294                                    temp_obj5.addPrintSubscription(obj1);
2295                                    break;
2296                }
2297            }
2298                            if (newObject)
2299            {
2300                obj5.initPrintSubscriptions();
2301                obj5.addPrintSubscription(obj1);
2302            }
2303                                                                                    
2304                                                        
2305                            
2306              
2307                           omClass = ProductPeer.getOMClass();
2308                          Product obj6 = (Product)ProductPeer
2309                .row2Object( row, offset6, omClass);
2310
2311               newObject = true;
2312            for (int j = 0; j < results.size(); j++)
2313            {
2314                PrintSubscription temp_obj1 = (PrintSubscription)results.get(j);
2315                Product temp_obj6 = (Product)temp_obj1.getProduct();
2316                if (temp_obj6.getPrimaryKey().equals(obj6.getPrimaryKey()))
2317                {
2318                    newObject = false;
2319                                    temp_obj6.addPrintSubscription(obj1);
2320                                    break;
2321                }
2322            }
2323                            if (newObject)
2324            {
2325                obj6.initPrintSubscriptions();
2326                obj6.addPrintSubscription(obj1);
2327            }
2328                                                                                    
2329                                              results.add(obj1);
2330        }
2331        return results;
2332    }
2333                    
2334  
2335      /**
2336     * Returns the TableMap related to this peer. This method is not
2337     * needed for general use but a specific application could have a need.
2338     *
2339     * @throws TorqueException Any exceptions caught during processing will be
2340     * rethrown wrapped into a TorqueException.
2341     */

2342    protected static TableMap getTableMap()
2343        throws TorqueException
2344    {
2345        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
2346    }
2347   
2348    private static void setDbName(Criteria crit)
2349    {
2350        // Set the correct dbName if it has not been overridden
2351
// crit.getDbName will return the same object if not set to
2352
// another value so == check is okay and faster
2353
if (crit.getDbName() == Torque.getDefaultDB())
2354        {
2355            crit.setDbName(DATABASE_NAME);
2356        }
2357    }
2358}
2359
Popular Tags