KickJava   Java API By Example, From Geeks To Geeks.

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


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  * This class was autogenerated by Torque on:
39  *
40  * [Wed May 04 09:10:56 CEST 2005]
41  *
42  */

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

58     public static MapBuilder getMapBuilder()
59         throws TorqueException
60     {
61         return getMapBuilder(OutboxEventMapBuilder.CLASS_NAME);
62     }
63
64       /** the column name for the OUTBOX_EVENT_ID field */
65     public static final String JavaDoc OUTBOX_EVENT_ID;
66       /** the column name for the OUTBOX_EVENT_CODE field */
67     public static final String JavaDoc OUTBOX_EVENT_CODE;
68       /** the column name for the STATUS field */
69     public static final String JavaDoc STATUS;
70       /** the column name for the PRIORITY field */
71     public static final String JavaDoc PRIORITY;
72       /** the column name for the ISSUED_DATE field */
73     public static final String JavaDoc ISSUED_DATE;
74       /** the column name for the CLOSED_DATE field */
75     public static final String JavaDoc CLOSED_DATE;
76       /** the column name for the SENT_TIME field */
77     public static final String JavaDoc SENT_TIME;
78       /** the column name for the EVENT_CHANNEL field */
79     public static final String JavaDoc EVENT_CHANNEL;
80       /** the column name for the EVENT_TYPE field */
81     public static final String JavaDoc EVENT_TYPE;
82       /** the column name for the EMAIL_FORMAT field */
83     public static final String JavaDoc EMAIL_FORMAT;
84       /** the column name for the CUSTOMER_ID field */
85     public static final String JavaDoc CUSTOMER_ID;
86       /** the column name for the PROJECT_ID field */
87     public static final String JavaDoc PROJECT_ID;
88       /** the column name for the PRODUCT_ID field */
89     public static final String JavaDoc PRODUCT_ID;
90       /** the column name for the RECEIVER_TO field */
91     public static final String JavaDoc RECEIVER_TO;
92       /** the column name for the RECEIVER_CC field */
93     public static final String JavaDoc RECEIVER_CC;
94       /** the column name for the SUBJECT field */
95     public static final String JavaDoc SUBJECT;
96       /** the column name for the BODY field */
97     public static final String JavaDoc BODY;
98       /** the column name for the NOTES field */
99     public static final String JavaDoc NOTES;
100       /** the column name for the CREATED field */
101     public static final String JavaDoc CREATED;
102       /** the column name for the MODIFIED field */
103     public static final String JavaDoc MODIFIED;
104       /** the column name for the CREATED_BY field */
105     public static final String JavaDoc CREATED_BY;
106       /** the column name for the MODIFIED_BY field */
107     public static final String JavaDoc MODIFIED_BY;
108   
109     static
110     {
111           OUTBOX_EVENT_ID = "OUTBOX_EVENT.OUTBOX_EVENT_ID";
112           OUTBOX_EVENT_CODE = "OUTBOX_EVENT.OUTBOX_EVENT_CODE";
113           STATUS = "OUTBOX_EVENT.STATUS";
114           PRIORITY = "OUTBOX_EVENT.PRIORITY";
115           ISSUED_DATE = "OUTBOX_EVENT.ISSUED_DATE";
116           CLOSED_DATE = "OUTBOX_EVENT.CLOSED_DATE";
117           SENT_TIME = "OUTBOX_EVENT.SENT_TIME";
118           EVENT_CHANNEL = "OUTBOX_EVENT.EVENT_CHANNEL";
119           EVENT_TYPE = "OUTBOX_EVENT.EVENT_TYPE";
120           EMAIL_FORMAT = "OUTBOX_EVENT.EMAIL_FORMAT";
121           CUSTOMER_ID = "OUTBOX_EVENT.CUSTOMER_ID";
122           PROJECT_ID = "OUTBOX_EVENT.PROJECT_ID";
123           PRODUCT_ID = "OUTBOX_EVENT.PRODUCT_ID";
124           RECEIVER_TO = "OUTBOX_EVENT.RECEIVER_TO";
125           RECEIVER_CC = "OUTBOX_EVENT.RECEIVER_CC";
126           SUBJECT = "OUTBOX_EVENT.SUBJECT";
127           BODY = "OUTBOX_EVENT.BODY";
128           NOTES = "OUTBOX_EVENT.NOTES";
129           CREATED = "OUTBOX_EVENT.CREATED";
130           MODIFIED = "OUTBOX_EVENT.MODIFIED";
131           CREATED_BY = "OUTBOX_EVENT.CREATED_BY";
132           MODIFIED_BY = "OUTBOX_EVENT.MODIFIED_BY";
133           if (Torque.isInit())
134         {
135             try
136             {
137                 getMapBuilder(OutboxEventMapBuilder.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(OutboxEventMapBuilder.CLASS_NAME);
147         }
148     }
149  
150     /** number of columns for this peer */
151     public static final int numColumns = 22;
152
153     /** A class that can be returned by this peer. */
154     protected static final String JavaDoc CLASSNAME_DEFAULT =
155         "org.campware.cream.om.OutboxEvent";
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 BaseOutboxEventPeer
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(OUTBOX_EVENT_ID);
285           criteria.addSelectColumn(OUTBOX_EVENT_CODE);
286           criteria.addSelectColumn(STATUS);
287           criteria.addSelectColumn(PRIORITY);
288           criteria.addSelectColumn(ISSUED_DATE);
289           criteria.addSelectColumn(CLOSED_DATE);
290           criteria.addSelectColumn(SENT_TIME);
291           criteria.addSelectColumn(EVENT_CHANNEL);
292           criteria.addSelectColumn(EVENT_TYPE);
293           criteria.addSelectColumn(EMAIL_FORMAT);
294           criteria.addSelectColumn(CUSTOMER_ID);
295           criteria.addSelectColumn(PROJECT_ID);
296           criteria.addSelectColumn(PRODUCT_ID);
297           criteria.addSelectColumn(RECEIVER_TO);
298           criteria.addSelectColumn(RECEIVER_CC);
299           criteria.addSelectColumn(SUBJECT);
300           criteria.addSelectColumn(BODY);
301           criteria.addSelectColumn(NOTES);
302           criteria.addSelectColumn(CREATED);
303           criteria.addSelectColumn(MODIFIED);
304           criteria.addSelectColumn(CREATED_BY);
305           criteria.addSelectColumn(MODIFIED_BY);
306       }
307
308     /**
309      * Create a new object of type cls from a resultset row starting
310      * from a specified offset. This is done so that you can select
311      * other rows than just those needed for this object. You may
312      * for example want to create two objects from the same row.
313      *
314      * @throws TorqueException Any exceptions caught during processing will be
315      * rethrown wrapped into a TorqueException.
316      */

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

1226    protected static List JavaDoc doSelectJoinAllExceptProject(Criteria criteria)
1227        throws TorqueException
1228    {
1229        setDbName(criteria);
1230
1231        addSelectColumns(criteria);
1232        int offset2 = numColumns + 1;
1233                                    
1234                    CustomerPeer.addSelectColumns(criteria);
1235        int offset3 = offset2 + CustomerPeer.numColumns;
1236                                                                
1237                                                  
1238                    ProductPeer.addSelectColumns(criteria);
1239        int offset4 = offset3 + ProductPeer.numColumns;
1240                                                                                                                                                                                                                                                                                                                                                                                                                                                                
1241        List JavaDoc rows = BasePeer.doSelect(criteria);
1242        List JavaDoc results = new ArrayList JavaDoc();
1243
1244        for (int i = 0; i < rows.size(); i++)
1245        {
1246            Record row = (Record)rows.get(i);
1247
1248                            Class JavaDoc omClass = OutboxEventPeer.getOMClass();
1249                    OutboxEvent obj1 = (OutboxEvent)OutboxEventPeer
1250                .row2Object(row, 1, omClass);
1251                                                
1252                                                        
1253                            
1254              
1255                           omClass = CustomerPeer.getOMClass();
1256                          Customer obj2 = (Customer)CustomerPeer
1257                .row2Object( row, offset2, omClass);
1258
1259               boolean newObject = true;
1260            for (int j = 0; j < results.size(); j++)
1261            {
1262                OutboxEvent temp_obj1 = (OutboxEvent)results.get(j);
1263                Customer temp_obj2 = (Customer)temp_obj1.getCustomer();
1264                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1265                {
1266                    newObject = false;
1267                                    temp_obj2.addOutboxEvent(obj1);
1268                                    break;
1269                }
1270            }
1271                            if (newObject)
1272            {
1273                obj2.initOutboxEvents();
1274                obj2.addOutboxEvent(obj1);
1275            }
1276                                                                                    
1277                                                                  
1278                                                        
1279                            
1280              
1281                           omClass = ProductPeer.getOMClass();
1282                          Product obj3 = (Product)ProductPeer
1283                .row2Object( row, offset3, omClass);
1284
1285               newObject = true;
1286            for (int j = 0; j < results.size(); j++)
1287            {
1288                OutboxEvent temp_obj1 = (OutboxEvent)results.get(j);
1289                Product temp_obj3 = (Product)temp_obj1.getProduct();
1290                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1291                {
1292                    newObject = false;
1293                                    temp_obj3.addOutboxEvent(obj1);
1294                                    break;
1295                }
1296            }
1297                            if (newObject)
1298            {
1299                obj3.initOutboxEvents();
1300                obj3.addOutboxEvent(obj1);
1301            }
1302                                                                results.add(obj1);
1303        }
1304        return results;
1305    }
1306        
1307        
1308                                  
1309                
1310
1311    /**
1312     * selects a collection of OutboxEvent objects pre-filled with
1313     * all related objects.
1314     *
1315     * This method is protected by default in order to keep the public
1316     * api reasonable. You can provide public methods for those you
1317     * actually need in OutboxEventPeer.
1318     *
1319     * @throws TorqueException Any exceptions caught during processing will be
1320     * rethrown wrapped into a TorqueException.
1321     */

1322    protected static List JavaDoc doSelectJoinAllExceptProduct(Criteria criteria)
1323        throws TorqueException
1324    {
1325        setDbName(criteria);
1326
1327        addSelectColumns(criteria);
1328        int offset2 = numColumns + 1;
1329                                    
1330                    CustomerPeer.addSelectColumns(criteria);
1331        int offset3 = offset2 + CustomerPeer.numColumns;
1332                                                                
1333                    ProjectPeer.addSelectColumns(criteria);
1334        int offset4 = offset3 + ProjectPeer.numColumns;
1335                                                                
1336                                                                                                                                                                                                                                                                                                                                                                                                                                                  
1337        List JavaDoc rows = BasePeer.doSelect(criteria);
1338        List JavaDoc results = new ArrayList JavaDoc();
1339
1340        for (int i = 0; i < rows.size(); i++)
1341        {
1342            Record row = (Record)rows.get(i);
1343
1344                            Class JavaDoc omClass = OutboxEventPeer.getOMClass();
1345                    OutboxEvent obj1 = (OutboxEvent)OutboxEventPeer
1346                .row2Object(row, 1, omClass);
1347                                                
1348                                                        
1349                            
1350              
1351                           omClass = CustomerPeer.getOMClass();
1352                          Customer obj2 = (Customer)CustomerPeer
1353                .row2Object( row, offset2, omClass);
1354
1355               boolean newObject = true;
1356            for (int j = 0; j < results.size(); j++)
1357            {
1358                OutboxEvent temp_obj1 = (OutboxEvent)results.get(j);
1359                Customer temp_obj2 = (Customer)temp_obj1.getCustomer();
1360                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1361                {
1362                    newObject = false;
1363                                    temp_obj2.addOutboxEvent(obj1);
1364                                    break;
1365                }
1366            }
1367                            if (newObject)
1368            {
1369                obj2.initOutboxEvents();
1370                obj2.addOutboxEvent(obj1);
1371            }
1372                                                                                    
1373                                                        
1374                            
1375              
1376                           omClass = ProjectPeer.getOMClass();
1377                          Project obj3 = (Project)ProjectPeer
1378                .row2Object( row, offset3, omClass);
1379
1380               newObject = true;
1381            for (int j = 0; j < results.size(); j++)
1382            {
1383                OutboxEvent temp_obj1 = (OutboxEvent)results.get(j);
1384                Project temp_obj3 = (Project)temp_obj1.getProject();
1385                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1386                {
1387                    newObject = false;
1388                                    temp_obj3.addOutboxEvent(obj1);
1389                                    break;
1390                }
1391            }
1392                            if (newObject)
1393            {
1394                obj3.initOutboxEvents();
1395                obj3.addOutboxEvent(obj1);
1396            }
1397                                                                                    
1398                                              results.add(obj1);
1399        }
1400        return results;
1401    }
1402                    
1403  
1404      /**
1405     * Returns the TableMap related to this peer. This method is not
1406     * needed for general use but a specific application could have a need.
1407     *
1408     * @throws TorqueException Any exceptions caught during processing will be
1409     * rethrown wrapped into a TorqueException.
1410     */

1411    protected static TableMap getTableMap()
1412        throws TorqueException
1413    {
1414        return Torque.getDatabaseMap(DATABASE_NAME).getTable(TABLE_NAME);
1415    }
1416   
1417    private static void setDbName(Criteria crit)
1418    {
1419        // Set the correct dbName if it has not been overridden
1420
// crit.getDbName will return the same object if not set to
1421
// another value so == check is okay and faster
1422
if (crit.getDbName() == Torque.getDefaultDB())
1423        {
1424            crit.setDbName(DATABASE_NAME);
1425        }
1426    }
1427}
1428
Popular Tags