KickJava   Java API By Example, From Geeks To Geeks.

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


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 BaseInboxEventPeer
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 = "INBOX_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(InboxEventMapBuilder.CLASS_NAME);
62     }
63
64       /** the column name for the INBOX_EVENT_ID field */
65     public static final String JavaDoc INBOX_EVENT_ID;
66       /** the column name for the INBOX_EVENT_CODE field */
67     public static final String JavaDoc INBOX_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 EVENT_CHANNEL field */
77     public static final String JavaDoc EVENT_CHANNEL;
78       /** the column name for the EVENT_TYPE field */
79     public static final String JavaDoc EVENT_TYPE;
80       /** the column name for the EMAIL_FORMAT field */
81     public static final String JavaDoc EMAIL_FORMAT;
82       /** the column name for the CUSTOMER_ID field */
83     public static final String JavaDoc CUSTOMER_ID;
84       /** the column name for the PROJECT_ID field */
85     public static final String JavaDoc PROJECT_ID;
86       /** the column name for the PRODUCT_ID field */
87     public static final String JavaDoc PRODUCT_ID;
88       /** the column name for the SENDER_NAME field */
89     public static final String JavaDoc SENDER_NAME;
90       /** the column name for the SENDER_EMAIL field */
91     public static final String JavaDoc SENDER_EMAIL;
92       /** the column name for the SENDER_REPLY_TO field */
93     public static final String JavaDoc SENDER_REPLY_TO;
94       /** the column name for the SENT_TIME field */
95     public static final String JavaDoc SENT_TIME;
96       /** the column name for the SENDER_TO field */
97     public static final String JavaDoc SENDER_TO;
98       /** the column name for the SENDER_CC field */
99     public static final String JavaDoc SENDER_CC;
100       /** the column name for the SUBJECT field */
101     public static final String JavaDoc SUBJECT;
102       /** the column name for the BODY field */
103     public static final String JavaDoc BODY;
104       /** the column name for the NOTES field */
105     public static final String JavaDoc NOTES;
106       /** the column name for the CREATED field */
107     public static final String JavaDoc CREATED;
108       /** the column name for the MODIFIED field */
109     public static final String JavaDoc MODIFIED;
110       /** the column name for the CREATED_BY field */
111     public static final String JavaDoc CREATED_BY;
112       /** the column name for the MODIFIED_BY field */
113     public static final String JavaDoc MODIFIED_BY;
114   
115     static
116     {
117           INBOX_EVENT_ID = "INBOX_EVENT.INBOX_EVENT_ID";
118           INBOX_EVENT_CODE = "INBOX_EVENT.INBOX_EVENT_CODE";
119           STATUS = "INBOX_EVENT.STATUS";
120           PRIORITY = "INBOX_EVENT.PRIORITY";
121           ISSUED_DATE = "INBOX_EVENT.ISSUED_DATE";
122           CLOSED_DATE = "INBOX_EVENT.CLOSED_DATE";
123           EVENT_CHANNEL = "INBOX_EVENT.EVENT_CHANNEL";
124           EVENT_TYPE = "INBOX_EVENT.EVENT_TYPE";
125           EMAIL_FORMAT = "INBOX_EVENT.EMAIL_FORMAT";
126           CUSTOMER_ID = "INBOX_EVENT.CUSTOMER_ID";
127           PROJECT_ID = "INBOX_EVENT.PROJECT_ID";
128           PRODUCT_ID = "INBOX_EVENT.PRODUCT_ID";
129           SENDER_NAME = "INBOX_EVENT.SENDER_NAME";
130           SENDER_EMAIL = "INBOX_EVENT.SENDER_EMAIL";
131           SENDER_REPLY_TO = "INBOX_EVENT.SENDER_REPLY_TO";
132           SENT_TIME = "INBOX_EVENT.SENT_TIME";
133           SENDER_TO = "INBOX_EVENT.SENDER_TO";
134           SENDER_CC = "INBOX_EVENT.SENDER_CC";
135           SUBJECT = "INBOX_EVENT.SUBJECT";
136           BODY = "INBOX_EVENT.BODY";
137           NOTES = "INBOX_EVENT.NOTES";
138           CREATED = "INBOX_EVENT.CREATED";
139           MODIFIED = "INBOX_EVENT.MODIFIED";
140           CREATED_BY = "INBOX_EVENT.CREATED_BY";
141           MODIFIED_BY = "INBOX_EVENT.MODIFIED_BY";
142           if (Torque.isInit())
143         {
144             try
145             {
146                 getMapBuilder(InboxEventMapBuilder.CLASS_NAME);
147             }
148             catch (Exception JavaDoc e)
149             {
150                 log.error("Could not initialize Peer", e);
151             }
152         }
153         else
154         {
155             Torque.registerMapBuilder(InboxEventMapBuilder.CLASS_NAME);
156         }
157     }
158  
159     /** number of columns for this peer */
160     public static final int numColumns = 25;
161
162     /** A class that can be returned by this peer. */
163     protected static final String JavaDoc CLASSNAME_DEFAULT =
164         "org.campware.cream.om.InboxEvent";
165
166     /** A class that can be returned by this peer. */
167     protected static final Class JavaDoc CLASS_DEFAULT = initClass(CLASSNAME_DEFAULT);
168
169     /**
170      * Class object initialization method.
171      *
172      * @param className name of the class to initialize
173      * @return the initialized class
174      */

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

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

250     public static ObjectKey doInsert(Criteria criteria)
251         throws TorqueException
252     {
253         return BaseInboxEventPeer
254             .doInsert(criteria, (Connection JavaDoc) null);
255     }
256
257     /**
258      * Method to do inserts. This method is to be used during a transaction,
259      * otherwise use the doInsert(Criteria) method. It will take care of
260      * the connection details internally.
261      *
262      * @param criteria object used to create the INSERT statement.
263      * @param con the connection to use
264      * @throws TorqueException Any exceptions caught during processing will be
265      * rethrown wrapped into a TorqueException.
266      */

267     public static ObjectKey doInsert(Criteria criteria, Connection JavaDoc con)
268         throws TorqueException
269     {
270                                                                                                                                                         
271         setDbName(criteria);
272
273         if (con == null)
274         {
275             return BasePeer.doInsert(criteria);
276         }
277         else
278         {
279             return BasePeer.doInsert(criteria, con);
280         }
281     }
282
283     /**
284      * Add all the columns needed to create a new object.
285      *
286      * @param criteria object containing the columns to add.
287      * @throws TorqueException Any exceptions caught during processing will be
288      * rethrown wrapped into a TorqueException.
289      */

290     public static void addSelectColumns(Criteria criteria)
291             throws TorqueException
292     {
293           criteria.addSelectColumn(INBOX_EVENT_ID);
294           criteria.addSelectColumn(INBOX_EVENT_CODE);
295           criteria.addSelectColumn(STATUS);
296           criteria.addSelectColumn(PRIORITY);
297           criteria.addSelectColumn(ISSUED_DATE);
298           criteria.addSelectColumn(CLOSED_DATE);
299           criteria.addSelectColumn(EVENT_CHANNEL);
300           criteria.addSelectColumn(EVENT_TYPE);
301           criteria.addSelectColumn(EMAIL_FORMAT);
302           criteria.addSelectColumn(CUSTOMER_ID);
303           criteria.addSelectColumn(PROJECT_ID);
304           criteria.addSelectColumn(PRODUCT_ID);
305           criteria.addSelectColumn(SENDER_NAME);
306           criteria.addSelectColumn(SENDER_EMAIL);
307           criteria.addSelectColumn(SENDER_REPLY_TO);
308           criteria.addSelectColumn(SENT_TIME);
309           criteria.addSelectColumn(SENDER_TO);
310           criteria.addSelectColumn(SENDER_CC);
311           criteria.addSelectColumn(SUBJECT);
312           criteria.addSelectColumn(BODY);
313           criteria.addSelectColumn(NOTES);
314           criteria.addSelectColumn(CREATED);
315           criteria.addSelectColumn(MODIFIED);
316           criteria.addSelectColumn(CREATED_BY);
317           criteria.addSelectColumn(MODIFIED_BY);
318       }
319
320     /**
321      * Create a new object of type cls from a resultset row starting
322      * from a specified offset. This is done so that you can select
323      * other rows than just those needed for this object. You may
324      * for example want to create two objects from the same row.
325      *
326      * @throws TorqueException Any exceptions caught during processing will be
327      * rethrown wrapped into a TorqueException.
328      */

329     public static InboxEvent row2Object(Record row,
330                                              int offset,
331                                              Class JavaDoc cls)
332         throws TorqueException
333     {
334         try
335         {
336             InboxEvent obj = (InboxEvent) cls.newInstance();
337             InboxEventPeer.populateObject(row, offset, obj);
338                   obj.setModified(false);
339               obj.setNew(false);
340
341             return obj;
342         }
343         catch (InstantiationException JavaDoc e)
344         {
345             throw new TorqueException(e);
346         }
347         catch (IllegalAccessException JavaDoc e)
348         {
349             throw new TorqueException(e);
350         }
351     }
352
353     /**
354      * Populates an object from a resultset row starting
355      * from a specified offset. This is done so that you can select
356      * other rows than just those needed for this object. You may
357      * for example want to create two objects from the same row.
358      *
359      * @throws TorqueException Any exceptions caught during processing will be
360      * rethrown wrapped into a TorqueException.
361      */

362     public static void populateObject(Record row,
363                                       int offset,
364                                       InboxEvent obj)
365         throws TorqueException
366     {
367         try
368         {
369                 obj.setInboxEventId(row.getValue(offset + 0).asInt());
370                   obj.setInboxEventCode(row.getValue(offset + 1).asString());
371                   obj.setStatus(row.getValue(offset + 2).asInt());
372                   obj.setPriority(row.getValue(offset + 3).asInt());
373                   obj.setIssuedDate(row.getValue(offset + 4).asUtilDate());
374                   obj.setClosedDate(row.getValue(offset + 5).asUtilDate());
375                   obj.setEventChannel(row.getValue(offset + 6).asInt());
376                   obj.setEventType(row.getValue(offset + 7).asInt());
377                   obj.setEmailFormat(row.getValue(offset + 8).asInt());
378                   obj.setCustomerId(row.getValue(offset + 9).asInt());
379                   obj.setProjectId(row.getValue(offset + 10).asInt());
380                   obj.setProductId(row.getValue(offset + 11).asInt());
381                   obj.setSenderName(row.getValue(offset + 12).asString());
382                   obj.setSenderEmail(row.getValue(offset + 13).asString());
383                   obj.setSenderReplyTo(row.getValue(offset + 14).asString());
384                   obj.setSentTime(row.getValue(offset + 15).asUtilDate());
385                   obj.setSenderTo(row.getValue(offset + 16).asString());
386                   obj.setSenderCc(row.getValue(offset + 17).asString());
387                   obj.setSubject(row.getValue(offset + 18).asString());
388                   obj.setBody(row.getValue(offset + 19).asString());
389                   obj.setNotes(row.getValue(offset + 20).asString());
390                   obj.setCreated(row.getValue(offset + 21).asUtilDate());
391                   obj.setModified(row.getValue(offset + 22).asUtilDate());
392                   obj.setCreatedBy(row.getValue(offset + 23).asString());
393                   obj.setModifiedBy(row.getValue(offset + 24).asString());
394               }
395         catch (DataSetException e)
396         {
397             throw new TorqueException(e);
398         }
399     }
400
401     /**
402      * Method to do selects.
403      *
404      * @param criteria object used to create the SELECT statement.
405      * @return List of selected Objects
406      * @throws TorqueException Any exceptions caught during processing will be
407      * rethrown wrapped into a TorqueException.
408      */

409     public static List JavaDoc doSelect(Criteria criteria) throws TorqueException
410     {
411         return populateObjects(doSelectVillageRecords(criteria));
412     }
413
414     /**
415      * Method to do selects within a transaction.
416      *
417      * @param criteria object used to create the SELECT statement.
418      * @param con the connection to use
419      * @return List of selected Objects
420      * @throws TorqueException Any exceptions caught during processing will be
421      * rethrown wrapped into a TorqueException.
422      */

423     public static List JavaDoc doSelect(Criteria criteria, Connection JavaDoc con)
424         throws TorqueException
425     {
426         return populateObjects(doSelectVillageRecords(criteria, con));
427     }
428
429     /**
430      * Grabs the raw Village records to be formed into objects.
431      * This method handles connections internally. The Record objects
432      * returned by this method should be considered readonly. Do not
433      * alter the data and call save(), your results may vary, but are
434      * certainly likely to result in hard to track MT bugs.
435      *
436      * @throws TorqueException Any exceptions caught during processing will be
437      * rethrown wrapped into a TorqueException.
438      */

439     public static List JavaDoc doSelectVillageRecords(Criteria criteria)
440         throws TorqueException
441     {
442         return BaseInboxEventPeer
443             .doSelectVillageRecords(criteria, (Connection JavaDoc) null);
444     }
445
446     /**
447      * Grabs the raw Village records to be formed into objects.
448      * This method should be used for transactions
449      *
450      * @param criteria object used to create the SELECT statement.
451      * @param con the connection to use
452      * @throws TorqueException Any exceptions caught during processing will be
453      * rethrown wrapped into a TorqueException.
454      */

455     public static List JavaDoc doSelectVillageRecords(Criteria criteria, Connection JavaDoc con)
456         throws TorqueException
457     {
458         if (criteria.getSelectColumns().size() == 0)
459         {
460             addSelectColumns(criteria);
461         }
462
463                                                                                                                                                         
464         setDbName(criteria);
465
466         // BasePeer returns a List of Value (Village) arrays. The array
467
// order follows the order columns were placed in the Select clause.
468
if (con == null)
469         {
470             return BasePeer.doSelect(criteria);
471         }
472         else
473         {
474             return BasePeer.doSelect(criteria, con);
475         }
476     }
477
478     /**
479      * The returned List will contain objects of the default type or
480      * objects that inherit from the default.
481      *
482      * @throws TorqueException Any exceptions caught during processing will be
483      * rethrown wrapped into a TorqueException.
484      */

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

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

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

540     public static void doUpdate(Criteria criteria, Connection JavaDoc con)
541         throws TorqueException
542     {
543         Criteria selectCriteria = new Criteria(DATABASE_NAME, 2);
544                    selectCriteria.put(INBOX_EVENT_ID, criteria.remove(INBOX_EVENT_ID));
545                                                                                                                                                                                                                                                       
546         setDbName(criteria);
547
548         if (con == null)
549         {
550             BasePeer.doUpdate(selectCriteria, criteria);
551         }
552         else
553         {
554             BasePeer.doUpdate(selectCriteria, criteria, con);
555         }
556     }
557
558     /**
559      * Method to do deletes.
560      *
561      * @param criteria object containing data that is used DELETE from database.
562      * @throws TorqueException Any exceptions caught during processing will be
563      * rethrown wrapped into a TorqueException.
564      */

565      public static void doDelete(Criteria criteria) throws TorqueException
566      {
567          InboxEventPeer
568             .doDelete(criteria, (Connection JavaDoc) null);
569      }
570
571     /**
572      * Method to do deletes. This method is to be used during a transaction,
573      * otherwise use the doDelete(Criteria) method. It will take care of
574      * the connection details internally.
575      *
576      * @param criteria object containing data that is used DELETE from database.
577      * @param con the connection to use
578      * @throws TorqueException Any exceptions caught during processing will be
579      * rethrown wrapped into a TorqueException.
580      */

581      public static void doDelete(Criteria criteria, Connection JavaDoc con)
582         throws TorqueException
583      {
584                                                                                                                                                         
585         setDbName(criteria);
586
587         if (con == null)
588         {
589             BasePeer.doDelete(criteria);
590         }
591         else
592         {
593             BasePeer.doDelete(criteria, con);
594         }
595      }
596
597     /**
598      * Method to do selects
599      *
600      * @throws TorqueException Any exceptions caught during processing will be
601      * rethrown wrapped into a TorqueException.
602      */

603     public static List JavaDoc doSelect(InboxEvent obj) throws TorqueException
604     {
605         return doSelect(buildSelectCriteria(obj));
606     }
607
608     /**
609      * Method to do inserts
610      *
611      * @throws TorqueException Any exceptions caught during processing will be
612      * rethrown wrapped into a TorqueException.
613      */

614     public static void doInsert(InboxEvent obj) throws TorqueException
615     {
616           obj.setPrimaryKey(doInsert(buildCriteria(obj)));
617           obj.setNew(false);
618         obj.setModified(false);
619     }
620
621     /**
622      * @param obj the data object to update in the database.
623      * @throws TorqueException Any exceptions caught during processing will be
624      * rethrown wrapped into a TorqueException.
625      */

626     public static void doUpdate(InboxEvent obj) throws TorqueException
627     {
628         doUpdate(buildCriteria(obj));
629         obj.setModified(false);
630     }
631
632     /**
633      * @param obj the data object to delete in the database.
634      * @throws TorqueException Any exceptions caught during processing will be
635      * rethrown wrapped into a TorqueException.
636      */

637     public static void doDelete(InboxEvent obj) throws TorqueException
638     {
639         doDelete(buildSelectCriteria(obj));
640     }
641
642     /**
643      * Method to do inserts. This method is to be used during a transaction,
644      * otherwise use the doInsert(InboxEvent) method. It will take
645      * care of the connection details internally.
646      *
647      * @param obj the data object to insert into the database.
648      * @param con the connection to use
649      * @throws TorqueException Any exceptions caught during processing will be
650      * rethrown wrapped into a TorqueException.
651      */

652     public static void doInsert(InboxEvent obj, Connection JavaDoc con)
653         throws TorqueException
654     {
655           obj.setPrimaryKey(doInsert(buildCriteria(obj), con));
656           obj.setNew(false);
657         obj.setModified(false);
658     }
659
660     /**
661      * Method to do update. This method is to be used during a transaction,
662      * otherwise use the doUpdate(InboxEvent) method. It will take
663      * care of the connection details internally.
664      *
665      * @param obj the data object to update 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 doUpdate(InboxEvent obj, Connection JavaDoc con)
671         throws TorqueException
672     {
673         doUpdate(buildCriteria(obj), con);
674         obj.setModified(false);
675     }
676
677     /**
678      * Method to delete. This method is to be used during a transaction,
679      * otherwise use the doDelete(InboxEvent) method. It will take
680      * care of the connection details internally.
681      *
682      * @param obj the data object to delete in the database.
683      * @param con the connection to use
684      * @throws TorqueException Any exceptions caught during processing will be
685      * rethrown wrapped into a TorqueException.
686      */

687     public static void doDelete(InboxEvent obj, Connection JavaDoc con)
688         throws TorqueException
689     {
690         doDelete(buildSelectCriteria(obj), con);
691     }
692
693     /**
694      * Method to do deletes.
695      *
696      * @param pk ObjectKey that is used DELETE from database.
697      * @throws TorqueException Any exceptions caught during processing will be
698      * rethrown wrapped into a TorqueException.
699      */

700     public static void doDelete(ObjectKey pk) throws TorqueException
701     {
702         BaseInboxEventPeer
703            .doDelete(pk, (Connection JavaDoc) null);
704     }
705
706     /**
707      * Method to delete. This method is to be used during a transaction,
708      * otherwise use the doDelete(ObjectKey) method. It will take
709      * care of the connection details internally.
710      *
711      * @param pk the primary key for the object to delete in the database.
712      * @param con the connection to use
713      * @throws TorqueException Any exceptions caught during processing will be
714      * rethrown wrapped into a TorqueException.
715      */

716     public static void doDelete(ObjectKey pk, Connection JavaDoc con)
717         throws TorqueException
718     {
719         doDelete(buildCriteria(pk), con);
720     }
721
722     /** Build a Criteria object from an ObjectKey */
723     public static Criteria buildCriteria( ObjectKey pk )
724     {
725         Criteria criteria = new Criteria();
726               criteria.add(INBOX_EVENT_ID, pk);
727           return criteria;
728      }
729
730     /** Build a Criteria object from the data object for this peer */
731     public static Criteria buildCriteria( InboxEvent obj )
732     {
733         Criteria criteria = new Criteria(DATABASE_NAME);
734               if (!obj.isNew())
735             criteria.add(INBOX_EVENT_ID, obj.getInboxEventId());
736               criteria.add(INBOX_EVENT_CODE, obj.getInboxEventCode());
737               criteria.add(STATUS, obj.getStatus());
738               criteria.add(PRIORITY, obj.getPriority());
739               criteria.add(ISSUED_DATE, obj.getIssuedDate());
740               criteria.add(CLOSED_DATE, obj.getClosedDate());
741               criteria.add(EVENT_CHANNEL, obj.getEventChannel());
742               criteria.add(EVENT_TYPE, obj.getEventType());
743               criteria.add(EMAIL_FORMAT, obj.getEmailFormat());
744               criteria.add(CUSTOMER_ID, obj.getCustomerId());
745               criteria.add(PROJECT_ID, obj.getProjectId());
746               criteria.add(PRODUCT_ID, obj.getProductId());
747               criteria.add(SENDER_NAME, obj.getSenderName());
748               criteria.add(SENDER_EMAIL, obj.getSenderEmail());
749               criteria.add(SENDER_REPLY_TO, obj.getSenderReplyTo());
750               criteria.add(SENT_TIME, obj.getSentTime());
751               criteria.add(SENDER_TO, obj.getSenderTo());
752               criteria.add(SENDER_CC, obj.getSenderCc());
753               criteria.add(SUBJECT, obj.getSubject());
754               criteria.add(BODY, obj.getBody());
755               criteria.add(NOTES, obj.getNotes());
756               criteria.add(CREATED, obj.getCreated());
757               criteria.add(MODIFIED, obj.getModified());
758               criteria.add(CREATED_BY, obj.getCreatedBy());
759               criteria.add(MODIFIED_BY, obj.getModifiedBy());
760           return criteria;
761     }
762
763     /** Build a Criteria object from the data object for this peer, skipping all binary columns */
764     public static Criteria buildSelectCriteria( InboxEvent obj )
765     {
766         Criteria criteria = new Criteria(DATABASE_NAME);
767               if (!obj.isNew())
768                     criteria.add(INBOX_EVENT_ID, obj.getInboxEventId());
769                           criteria.add(INBOX_EVENT_CODE, obj.getInboxEventCode());
770                           criteria.add(STATUS, obj.getStatus());
771                           criteria.add(PRIORITY, obj.getPriority());
772                           criteria.add(ISSUED_DATE, obj.getIssuedDate());
773                           criteria.add(CLOSED_DATE, obj.getClosedDate());
774                           criteria.add(EVENT_CHANNEL, obj.getEventChannel());
775                           criteria.add(EVENT_TYPE, obj.getEventType());
776                           criteria.add(EMAIL_FORMAT, obj.getEmailFormat());
777                           criteria.add(CUSTOMER_ID, obj.getCustomerId());
778                           criteria.add(PROJECT_ID, obj.getProjectId());
779                           criteria.add(PRODUCT_ID, obj.getProductId());
780                           criteria.add(SENDER_NAME, obj.getSenderName());
781                           criteria.add(SENDER_EMAIL, obj.getSenderEmail());
782                           criteria.add(SENDER_REPLY_TO, obj.getSenderReplyTo());
783                           criteria.add(SENT_TIME, obj.getSentTime());
784                           criteria.add(SENDER_TO, obj.getSenderTo());
785                           criteria.add(SENDER_CC, obj.getSenderCc());
786                           criteria.add(SUBJECT, obj.getSubject());
787                           criteria.add(BODY, obj.getBody());
788                           criteria.add(NOTES, obj.getNotes());
789                           criteria.add(CREATED, obj.getCreated());
790                           criteria.add(MODIFIED, obj.getModified());
791                           criteria.add(CREATED_BY, obj.getCreatedBy());
792                           criteria.add(MODIFIED_BY, obj.getModifiedBy());
793               return criteria;
794     }
795  
796     
797         /**
798      * Retrieve a single object by pk
799      *
800      * @param pk the primary key
801      * @throws TorqueException Any exceptions caught during processing will be
802      * rethrown wrapped into a TorqueException.
803      * @throws NoRowsException Primary key was not found in database.
804      * @throws TooManyRowsException Primary key was not found in database.
805      */

806     public static InboxEvent retrieveByPK(int pk)
807         throws TorqueException, NoRowsException, TooManyRowsException
808     {
809         return retrieveByPK(SimpleKey.keyFor(pk));
810     }
811
812     /**
813      * Retrieve a single object by pk
814      *
815      * @param pk the primary key
816      * @param con the connection to use
817      * @throws TorqueException Any exceptions caught during processing will be
818      * rethrown wrapped into a TorqueException.
819      * @throws NoRowsException Primary key was not found in database.
820      * @throws TooManyRowsException Primary key was not found in database.
821      */

822     public static InboxEvent retrieveByPK(int pk, Connection JavaDoc con)
823         throws TorqueException, NoRowsException, TooManyRowsException
824     {
825         return retrieveByPK(SimpleKey.keyFor(pk), con);
826     }
827   
828     /**
829      * Retrieve a single object by pk
830      *
831      * @param pk the primary key
832      * @throws TorqueException Any exceptions caught during processing will be
833      * rethrown wrapped into a TorqueException.
834      * @throws NoRowsException Primary key was not found in database.
835      * @throws TooManyRowsException Primary key was not found in database.
836      */

837     public static InboxEvent retrieveByPK(ObjectKey pk)
838         throws TorqueException, NoRowsException, TooManyRowsException
839     {
840         Connection JavaDoc db = null;
841         InboxEvent retVal = null;
842         try
843         {
844             db = Torque.getConnection(DATABASE_NAME);
845             retVal = retrieveByPK(pk, db);
846         }
847         finally
848         {
849             Torque.closeConnection(db);
850         }
851         return(retVal);
852     }
853
854     /**
855      * Retrieve a single object by pk
856      *
857      * @param pk the primary key
858      * @param con the connection to use
859      * @throws TorqueException Any exceptions caught during processing will be
860      * rethrown wrapped into a TorqueException.
861      * @throws NoRowsException Primary key was not found in database.
862      * @throws TooManyRowsException Primary key was not found in database.
863      */

864     public static InboxEvent retrieveByPK(ObjectKey pk, Connection JavaDoc con)
865         throws TorqueException, NoRowsException, TooManyRowsException
866     {
867         Criteria criteria = buildCriteria(pk);
868         List JavaDoc v = doSelect(criteria, con);
869         if (v.size() == 0)
870         {
871             throw new NoRowsException("Failed to select a row.");
872         }
873         else if (v.size() > 1)
874         {
875             throw new TooManyRowsException("Failed to select only one row.");
876         }
877         else
878         {
879             return (InboxEvent)v.get(0);
880         }
881     }
882
883     /**
884      * Retrieve a multiple objects by pk
885      *
886      * @param pks List of primary keys
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)
891         throws TorqueException
892     {
893         Connection JavaDoc db = null;
894         List JavaDoc retVal = null;
895         try
896         {
897            db = Torque.getConnection(DATABASE_NAME);
898            retVal = retrieveByPKs(pks, db);
899         }
900         finally
901         {
902             Torque.closeConnection(db);
903         }
904         return(retVal);
905     }
906
907     /**
908      * Retrieve a multiple objects by pk
909      *
910      * @param pks List of primary keys
911      * @param dbcon the connection to use
912      * @throws TorqueException Any exceptions caught during processing will be
913      * rethrown wrapped into a TorqueException.
914      */

915     public static List JavaDoc retrieveByPKs( List JavaDoc pks, Connection JavaDoc dbcon )
916         throws TorqueException
917     {
918         List JavaDoc objs = null;
919         if (pks == null || pks.size() == 0)
920         {
921             objs = new LinkedList JavaDoc();
922         }
923         else
924         {
925             Criteria criteria = new Criteria();
926               criteria.addIn( INBOX_EVENT_ID, pks );
927           objs = doSelect(criteria, dbcon);
928         }
929         return objs;
930     }
931
932  
933
934
935
936               
937                                               
938                 
939                 
940
941     /**
942      * selects a collection of InboxEvent objects pre-filled with their
943      * Customer objects.
944      *
945      * This method is protected by default in order to keep the public
946      * api reasonable. You can provide public methods for those you
947      * actually need in InboxEventPeer.
948      *
949      * @throws TorqueException Any exceptions caught during processing will be
950      * rethrown wrapped into a TorqueException.
951      */

952     protected static List JavaDoc doSelectJoinCustomer(Criteria criteria)
953         throws TorqueException
954     {
955         setDbName(criteria);
956
957         InboxEventPeer.addSelectColumns(criteria);
958         int offset = numColumns + 1;
959         CustomerPeer.addSelectColumns(criteria);
960
961
962                         criteria.addJoin(InboxEventPeer.CUSTOMER_ID,
963             CustomerPeer.CUSTOMER_ID);
964         
965
966                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
967         List JavaDoc rows = BasePeer.doSelect(criteria);
968         List JavaDoc results = new ArrayList JavaDoc();
969
970         for (int i = 0; i < rows.size(); i++)
971         {
972             Record row = (Record) rows.get(i);
973
974                             Class JavaDoc omClass = InboxEventPeer.getOMClass();
975                     InboxEvent obj1 = (InboxEvent) InboxEventPeer
976                 .row2Object(row, 1, omClass);
977                      omClass = CustomerPeer.getOMClass();
978                     Customer obj2 = (Customer)CustomerPeer
979                 .row2Object(row, offset, omClass);
980
981             boolean newObject = true;
982             for (int j = 0; j < results.size(); j++)
983             {
984                 InboxEvent temp_obj1 = (InboxEvent)results.get(j);
985                 Customer temp_obj2 = (Customer)temp_obj1.getCustomer();
986                 if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
987                 {
988                     newObject = false;
989                               temp_obj2.addInboxEvent(obj1);
990                               break;
991                 }
992             }
993                       if (newObject)
994             {
995                 obj2.initInboxEvents();
996                 obj2.addInboxEvent(obj1);
997             }
998                       results.add(obj1);
999         }
1000        return results;
1001    }
1002                                                            
1003                
1004                
1005
1006    /**
1007     * selects a collection of InboxEvent objects pre-filled with their
1008     * Project objects.
1009     *
1010     * This method is protected by default in order to keep the public
1011     * api reasonable. You can provide public methods for those you
1012     * actually need in InboxEventPeer.
1013     *
1014     * @throws TorqueException Any exceptions caught during processing will be
1015     * rethrown wrapped into a TorqueException.
1016     */

1017    protected static List JavaDoc doSelectJoinProject(Criteria criteria)
1018        throws TorqueException
1019    {
1020        setDbName(criteria);
1021
1022        InboxEventPeer.addSelectColumns(criteria);
1023        int offset = numColumns + 1;
1024        ProjectPeer.addSelectColumns(criteria);
1025
1026
1027                        criteria.addJoin(InboxEventPeer.PROJECT_ID,
1028            ProjectPeer.PROJECT_ID);
1029        
1030
1031                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
1032        List JavaDoc rows = BasePeer.doSelect(criteria);
1033        List JavaDoc results = new ArrayList JavaDoc();
1034
1035        for (int i = 0; i < rows.size(); i++)
1036        {
1037            Record row = (Record) rows.get(i);
1038
1039                            Class JavaDoc omClass = InboxEventPeer.getOMClass();
1040                    InboxEvent obj1 = (InboxEvent) InboxEventPeer
1041                .row2Object(row, 1, omClass);
1042                     omClass = ProjectPeer.getOMClass();
1043                    Project obj2 = (Project)ProjectPeer
1044                .row2Object(row, offset, omClass);
1045
1046            boolean newObject = true;
1047            for (int j = 0; j < results.size(); j++)
1048            {
1049                InboxEvent temp_obj1 = (InboxEvent)results.get(j);
1050                Project temp_obj2 = (Project)temp_obj1.getProject();
1051                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1052                {
1053                    newObject = false;
1054                              temp_obj2.addInboxEvent(obj1);
1055                              break;
1056                }
1057            }
1058                      if (newObject)
1059            {
1060                obj2.initInboxEvents();
1061                obj2.addInboxEvent(obj1);
1062            }
1063                      results.add(obj1);
1064        }
1065        return results;
1066    }
1067                                                            
1068                
1069                
1070
1071    /**
1072     * selects a collection of InboxEvent objects pre-filled with their
1073     * Product objects.
1074     *
1075     * This method is protected by default in order to keep the public
1076     * api reasonable. You can provide public methods for those you
1077     * actually need in InboxEventPeer.
1078     *
1079     * @throws TorqueException Any exceptions caught during processing will be
1080     * rethrown wrapped into a TorqueException.
1081     */

1082    protected static List JavaDoc doSelectJoinProduct(Criteria criteria)
1083        throws TorqueException
1084    {
1085        setDbName(criteria);
1086
1087        InboxEventPeer.addSelectColumns(criteria);
1088        int offset = numColumns + 1;
1089        ProductPeer.addSelectColumns(criteria);
1090
1091
1092                        criteria.addJoin(InboxEventPeer.PRODUCT_ID,
1093            ProductPeer.PRODUCT_ID);
1094        
1095
1096                                                                                                                                                                                                                                                                                                                                                                                                                                                                          
1097        List JavaDoc rows = BasePeer.doSelect(criteria);
1098        List JavaDoc results = new ArrayList JavaDoc();
1099
1100        for (int i = 0; i < rows.size(); i++)
1101        {
1102            Record row = (Record) rows.get(i);
1103
1104                            Class JavaDoc omClass = InboxEventPeer.getOMClass();
1105                    InboxEvent obj1 = (InboxEvent) InboxEventPeer
1106                .row2Object(row, 1, omClass);
1107                     omClass = ProductPeer.getOMClass();
1108                    Product obj2 = (Product)ProductPeer
1109                .row2Object(row, offset, omClass);
1110
1111            boolean newObject = true;
1112            for (int j = 0; j < results.size(); j++)
1113            {
1114                InboxEvent temp_obj1 = (InboxEvent)results.get(j);
1115                Product temp_obj2 = (Product)temp_obj1.getProduct();
1116                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1117                {
1118                    newObject = false;
1119                              temp_obj2.addInboxEvent(obj1);
1120                              break;
1121                }
1122            }
1123                      if (newObject)
1124            {
1125                obj2.initInboxEvents();
1126                obj2.addInboxEvent(obj1);
1127            }
1128                      results.add(obj1);
1129        }
1130        return results;
1131    }
1132                    
1133  
1134                                    
1135          
1136        
1137                                  
1138                
1139
1140    /**
1141     * selects a collection of InboxEvent objects pre-filled with
1142     * all related objects.
1143     *
1144     * This method is protected by default in order to keep the public
1145     * api reasonable. You can provide public methods for those you
1146     * actually need in InboxEventPeer.
1147     *
1148     * @throws TorqueException Any exceptions caught during processing will be
1149     * rethrown wrapped into a TorqueException.
1150     */

1151    protected static List JavaDoc doSelectJoinAllExceptCustomer(Criteria criteria)
1152        throws TorqueException
1153    {
1154        setDbName(criteria);
1155
1156        addSelectColumns(criteria);
1157        int offset2 = numColumns + 1;
1158                                    
1159                                                  
1160                    ProjectPeer.addSelectColumns(criteria);
1161        int offset3 = offset2 + ProjectPeer.numColumns;
1162                                                                
1163                    ProductPeer.addSelectColumns(criteria);
1164        int offset4 = offset3 + ProductPeer.numColumns;
1165                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      
1166        List JavaDoc rows = BasePeer.doSelect(criteria);
1167        List JavaDoc results = new ArrayList JavaDoc();
1168
1169        for (int i = 0; i < rows.size(); i++)
1170        {
1171            Record row = (Record)rows.get(i);
1172
1173                            Class JavaDoc omClass = InboxEventPeer.getOMClass();
1174                    InboxEvent obj1 = (InboxEvent)InboxEventPeer
1175                .row2Object(row, 1, omClass);
1176                                                
1177                                                                  
1178                                                        
1179                            
1180              
1181                           omClass = ProjectPeer.getOMClass();
1182                          Project obj2 = (Project)ProjectPeer
1183                .row2Object( row, offset2, omClass);
1184
1185               boolean newObject = true;
1186            for (int j = 0; j < results.size(); j++)
1187            {
1188                InboxEvent temp_obj1 = (InboxEvent)results.get(j);
1189                Project temp_obj2 = (Project)temp_obj1.getProject();
1190                if (temp_obj2.getPrimaryKey().equals(obj2.getPrimaryKey()))
1191                {
1192                    newObject = false;
1193                                    temp_obj2.addInboxEvent(obj1);
1194                                    break;
1195                }
1196            }
1197                            if (newObject)
1198            {
1199                obj2.initInboxEvents();
1200                obj2.addInboxEvent(obj1);
1201            }
1202                                                                                    
1203                                                        
1204                            
1205              
1206                           omClass = ProductPeer.getOMClass();
1207                          Product obj3 = (Product)ProductPeer
1208                .row2Object( row, offset3, omClass);
1209
1210               newObject = true;
1211            for (int j = 0; j < results.size(); j++)
1212            {
1213                InboxEvent temp_obj1 = (InboxEvent)results.get(j);
1214                Product temp_obj3 = (Product)temp_obj1.getProduct();
1215                if (temp_obj3.getPrimaryKey().equals(obj3.getPrimaryKey()))
1216                {
1217                    newObject = false;
1218                                    temp_obj3.addInboxEvent(obj1);
1219                                    break;
1220                }
1221            }
1222                            if (newObject)
1223            {
1224                obj3.initInboxEvents();
1225                obj3.addInboxEvent(obj1);
1226            }
1227                                                                results.add(obj1);
1228        }
1229        return results;
1230    }
1231        
1232        
1233                                  
1234                
1235
1236    /**
1237     * selects a collection of InboxEvent objects pre-filled with
1238     * all related objects.
1239     *
1240     * This method is protected by default in order to keep the public
1241     * api reasonable. You can provide public methods for those you
1242     * actually need in InboxEventPeer.
1243     *
1244     * @throws TorqueException Any exceptions caught during processing will be
1245     * rethrown wrapped into a TorqueException.
1246     */

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

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

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