KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.campware.cream.om;
2
3
4 import java.math.BigDecimal JavaDoc;
5 import java.sql.Connection JavaDoc;
6 import java.util.ArrayList JavaDoc;
7 import java.util.Collections JavaDoc;
8 import java.util.Date JavaDoc;
9 import java.util.List JavaDoc;
10
11 import org.apache.commons.lang.ObjectUtils;
12 import org.apache.turbine.om.Retrievable;
13 import org.apache.torque.TorqueException;
14 import org.apache.torque.om.BaseObject;
15 import org.apache.torque.om.ComboKey;
16 import org.apache.torque.om.DateKey;
17 import org.apache.torque.om.NumberKey;
18 import org.apache.torque.om.ObjectKey;
19 import org.apache.torque.om.SimpleKey;
20 import org.apache.torque.om.StringKey;
21 import org.apache.torque.om.Persistent;
22 import org.apache.torque.util.Criteria;
23 import org.apache.torque.util.Transaction;
24
25
26 /**
27  * This class was autogenerated by Torque on:
28  *
29  * [Wed May 04 09:10:56 CEST 2005]
30  *
31  * You should not use this class directly. It should not even be
32  * extended all references should be to Language
33  */

34 public abstract class BaseLanguage extends BaseObject
35     implements org.apache.turbine.om.Retrievable
36 {
37     /** The Peer class */
38     private static final LanguagePeer peer =
39         new LanguagePeer();
40
41         
42     /** The value for the languageId field */
43     private int languageId;
44       
45     /** The value for the languageName field */
46     private String JavaDoc languageName;
47       
48     /** The value for the languageCode field */
49     private String JavaDoc languageCode;
50   
51     
52     /**
53      * Get the LanguageId
54      *
55      * @return int
56      */

57     public int getLanguageId()
58     {
59         return languageId;
60     }
61
62                                               
63     /**
64      * Set the value of LanguageId
65      *
66      * @param v new value
67      */

68     public void setLanguageId(int v) throws TorqueException
69     {
70     
71                   if (this.languageId != v)
72               {
73             this.languageId = v;
74             setModified(true);
75         }
76     
77           
78                                   
79                   // update associated Notification
80
if (collNotifications != null)
81         {
82             for (int i = 0; i < collNotifications.size(); i++)
83             {
84                 ((Notification) collNotifications.get(i))
85                     .setLanguageId(v);
86             }
87         }
88                                                     
89                   // update associated Customer
90
if (collCustomers != null)
91         {
92             for (int i = 0; i < collCustomers.size(); i++)
93             {
94                 ((Customer) collCustomers.get(i))
95                     .setLanguageId(v);
96             }
97         }
98                                                     
99                   // update associated Newsletter
100
if (collNewslettersRelatedByCustLanguageId != null)
101         {
102             for (int i = 0; i < collNewslettersRelatedByCustLanguageId.size(); i++)
103             {
104                 ((Newsletter) collNewslettersRelatedByCustLanguageId.get(i))
105                     .setCustLanguageId(v);
106             }
107         }
108                                                     
109                   // update associated Newsletter
110
if (collNewslettersRelatedByLanguageId != null)
111         {
112             for (int i = 0; i < collNewslettersRelatedByLanguageId.size(); i++)
113             {
114                 ((Newsletter) collNewslettersRelatedByLanguageId.get(i))
115                     .setLanguageId(v);
116             }
117         }
118                                 }
119   
120     /**
121      * Get the LanguageName
122      *
123      * @return String
124      */

125     public String JavaDoc getLanguageName()
126     {
127         return languageName;
128     }
129
130                         
131     /**
132      * Set the value of LanguageName
133      *
134      * @param v new value
135      */

136     public void setLanguageName(String JavaDoc v)
137     {
138     
139                   if (!ObjectUtils.equals(this.languageName, v))
140               {
141             this.languageName = v;
142             setModified(true);
143         }
144     
145           
146               }
147   
148     /**
149      * Get the LanguageCode
150      *
151      * @return String
152      */

153     public String JavaDoc getLanguageCode()
154     {
155         return languageCode;
156     }
157
158                         
159     /**
160      * Set the value of LanguageCode
161      *
162      * @param v new value
163      */

164     public void setLanguageCode(String JavaDoc v)
165     {
166     
167                   if (!ObjectUtils.equals(this.languageCode, v))
168               {
169             this.languageCode = v;
170             setModified(true);
171         }
172     
173           
174               }
175   
176          
177                                 
178             
179           /**
180      * Collection to store aggregation of collNotifications
181      */

182     protected List JavaDoc collNotifications;
183
184     /**
185      * Temporary storage of collNotifications to save a possible db hit in
186      * the event objects are add to the collection, but the
187      * complete collection is never requested.
188      */

189     protected void initNotifications()
190     {
191         if (collNotifications == null)
192         {
193             collNotifications = new ArrayList JavaDoc();
194         }
195     }
196
197     /**
198      * Method called to associate a Notification object to this object
199      * through the Notification foreign key attribute
200      *
201      * @param l Notification
202      * @throws TorqueException
203      */

204     public void addNotification(Notification l) throws TorqueException
205     {
206         getNotifications().add(l);
207         l.setLanguage((Language) this);
208     }
209
210     /**
211      * The criteria used to select the current contents of collNotifications
212      */

213     private Criteria lastNotificationsCriteria = null;
214       
215     /**
216      * If this collection has already been initialized, returns
217      * the collection. Otherwise returns the results of
218      * getNotifications(new Criteria())
219      *
220      * @throws TorqueException
221      */

222     public List JavaDoc getNotifications() throws TorqueException
223     {
224               if (collNotifications == null)
225         {
226             collNotifications = getNotifications(new Criteria(10));
227         }
228         return collNotifications;
229           }
230
231     /**
232      * If this collection has already been initialized with
233      * an identical criteria, it returns the collection.
234      * Otherwise if this Language has previously
235      * been saved, it will retrieve related Notifications from storage.
236      * If this Language is new, it will return
237      * an empty collection or the current collection, the criteria
238      * is ignored on a new object.
239      *
240      * @throws TorqueException
241      */

242     public List JavaDoc getNotifications(Criteria criteria) throws TorqueException
243     {
244               if (collNotifications == null)
245         {
246             if (isNew())
247             {
248                collNotifications = new ArrayList JavaDoc();
249             }
250             else
251             {
252                         criteria.add(NotificationPeer.LANGUAGE_ID, getLanguageId() );
253                         collNotifications = NotificationPeer.doSelect(criteria);
254             }
255         }
256         else
257         {
258             // criteria has no effect for a new object
259
if (!isNew())
260             {
261                 // the following code is to determine if a new query is
262
// called for. If the criteria is the same as the last
263
// one, just return the collection.
264
criteria.add(NotificationPeer.LANGUAGE_ID, getLanguageId());
265                             if (!lastNotificationsCriteria.equals(criteria))
266                 {
267                     collNotifications = NotificationPeer.doSelect(criteria);
268                 }
269             }
270         }
271         lastNotificationsCriteria = criteria;
272
273         return collNotifications;
274           }
275
276     /**
277      * If this collection has already been initialized, returns
278      * the collection. Otherwise returns the results of
279      * getNotifications(new Criteria(),Connection)
280      * This method takes in the Connection also as input so that
281      * referenced objects can also be obtained using a Connection
282      * that is taken as input
283      */

284     public List JavaDoc getNotifications(Connection JavaDoc con) throws TorqueException
285     {
286               if (collNotifications == null)
287         {
288             collNotifications = getNotifications(new Criteria(10), con);
289         }
290         return collNotifications;
291           }
292
293     /**
294      * If this collection has already been initialized with
295      * an identical criteria, it returns the collection.
296      * Otherwise if this Language has previously
297      * been saved, it will retrieve related Notifications from storage.
298      * If this Language is new, it will return
299      * an empty collection or the current collection, the criteria
300      * is ignored on a new object.
301      * This method takes in the Connection also as input so that
302      * referenced objects can also be obtained using a Connection
303      * that is taken as input
304      */

305     public List JavaDoc getNotifications(Criteria criteria, Connection JavaDoc con)
306             throws TorqueException
307     {
308               if (collNotifications == null)
309         {
310             if (isNew())
311             {
312                collNotifications = new ArrayList JavaDoc();
313             }
314             else
315             {
316                          criteria.add(NotificationPeer.LANGUAGE_ID, getLanguageId());
317                          collNotifications = NotificationPeer.doSelect(criteria, con);
318              }
319          }
320          else
321          {
322              // criteria has no effect for a new object
323
if (!isNew())
324              {
325                  // the following code is to determine if a new query is
326
// called for. If the criteria is the same as the last
327
// one, just return the collection.
328
criteria.add(NotificationPeer.LANGUAGE_ID, getLanguageId());
329                              if (!lastNotificationsCriteria.equals(criteria))
330                  {
331                      collNotifications = NotificationPeer.doSelect(criteria, con);
332                  }
333              }
334          }
335          lastNotificationsCriteria = criteria;
336
337          return collNotifications;
338            }
339
340                   
341               
342                     
343                               
344                                 
345                                                               
346                                         
347                     
348                     
349           
350     /**
351      * If this collection has already been initialized with
352      * an identical criteria, it returns the collection.
353      * Otherwise if this Language is new, it will return
354      * an empty collection; or if this Language has previously
355      * been saved, it will retrieve related Notifications from storage.
356      *
357      * This method is protected by default in order to keep the public
358      * api reasonable. You can provide public methods for those you
359      * actually need in Language.
360      */

361     protected List JavaDoc getNotificationsJoinLanguage(Criteria criteria)
362         throws TorqueException
363     {
364                     if (collNotifications == null)
365         {
366             if (isNew())
367             {
368                collNotifications = new ArrayList JavaDoc();
369             }
370             else
371             {
372                               criteria.add(NotificationPeer.LANGUAGE_ID, getLanguageId());
373                               collNotifications = NotificationPeer.doSelectJoinLanguage(criteria);
374             }
375         }
376         else
377         {
378             // the following code is to determine if a new query is
379
// called for. If the criteria is the same as the last
380
// one, just return the collection.
381

382                         criteria.add(NotificationPeer.LANGUAGE_ID, getLanguageId());
383                                     if (!lastNotificationsCriteria.equals(criteria))
384             {
385                 collNotifications = NotificationPeer.doSelectJoinLanguage(criteria);
386             }
387         }
388         lastNotificationsCriteria = criteria;
389
390         return collNotifications;
391                 }
392                             
393
394
395                           
396             
397           /**
398      * Collection to store aggregation of collCustomers
399      */

400     protected List JavaDoc collCustomers;
401
402     /**
403      * Temporary storage of collCustomers to save a possible db hit in
404      * the event objects are add to the collection, but the
405      * complete collection is never requested.
406      */

407     protected void initCustomers()
408     {
409         if (collCustomers == null)
410         {
411             collCustomers = new ArrayList JavaDoc();
412         }
413     }
414
415     /**
416      * Method called to associate a Customer object to this object
417      * through the Customer foreign key attribute
418      *
419      * @param l Customer
420      * @throws TorqueException
421      */

422     public void addCustomer(Customer l) throws TorqueException
423     {
424         getCustomers().add(l);
425         l.setLanguage((Language) this);
426     }
427
428     /**
429      * The criteria used to select the current contents of collCustomers
430      */

431     private Criteria lastCustomersCriteria = null;
432       
433     /**
434      * If this collection has already been initialized, returns
435      * the collection. Otherwise returns the results of
436      * getCustomers(new Criteria())
437      *
438      * @throws TorqueException
439      */

440     public List JavaDoc getCustomers() throws TorqueException
441     {
442               if (collCustomers == null)
443         {
444             collCustomers = getCustomers(new Criteria(10));
445         }
446         return collCustomers;
447           }
448
449     /**
450      * If this collection has already been initialized with
451      * an identical criteria, it returns the collection.
452      * Otherwise if this Language has previously
453      * been saved, it will retrieve related Customers from storage.
454      * If this Language is new, it will return
455      * an empty collection or the current collection, the criteria
456      * is ignored on a new object.
457      *
458      * @throws TorqueException
459      */

460     public List JavaDoc getCustomers(Criteria criteria) throws TorqueException
461     {
462               if (collCustomers == null)
463         {
464             if (isNew())
465             {
466                collCustomers = new ArrayList JavaDoc();
467             }
468             else
469             {
470                         criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId() );
471                         collCustomers = CustomerPeer.doSelect(criteria);
472             }
473         }
474         else
475         {
476             // criteria has no effect for a new object
477
if (!isNew())
478             {
479                 // the following code is to determine if a new query is
480
// called for. If the criteria is the same as the last
481
// one, just return the collection.
482
criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
483                             if (!lastCustomersCriteria.equals(criteria))
484                 {
485                     collCustomers = CustomerPeer.doSelect(criteria);
486                 }
487             }
488         }
489         lastCustomersCriteria = criteria;
490
491         return collCustomers;
492           }
493
494     /**
495      * If this collection has already been initialized, returns
496      * the collection. Otherwise returns the results of
497      * getCustomers(new Criteria(),Connection)
498      * This method takes in the Connection also as input so that
499      * referenced objects can also be obtained using a Connection
500      * that is taken as input
501      */

502     public List JavaDoc getCustomers(Connection JavaDoc con) throws TorqueException
503     {
504               if (collCustomers == null)
505         {
506             collCustomers = getCustomers(new Criteria(10), con);
507         }
508         return collCustomers;
509           }
510
511     /**
512      * If this collection has already been initialized with
513      * an identical criteria, it returns the collection.
514      * Otherwise if this Language has previously
515      * been saved, it will retrieve related Customers from storage.
516      * If this Language is new, it will return
517      * an empty collection or the current collection, the criteria
518      * is ignored on a new object.
519      * This method takes in the Connection also as input so that
520      * referenced objects can also be obtained using a Connection
521      * that is taken as input
522      */

523     public List JavaDoc getCustomers(Criteria criteria, Connection JavaDoc con)
524             throws TorqueException
525     {
526               if (collCustomers == null)
527         {
528             if (isNew())
529             {
530                collCustomers = new ArrayList JavaDoc();
531             }
532             else
533             {
534                          criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
535                          collCustomers = CustomerPeer.doSelect(criteria, con);
536              }
537          }
538          else
539          {
540              // criteria has no effect for a new object
541
if (!isNew())
542              {
543                  // the following code is to determine if a new query is
544
// called for. If the criteria is the same as the last
545
// one, just return the collection.
546
criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
547                              if (!lastCustomersCriteria.equals(criteria))
548                  {
549                      collCustomers = CustomerPeer.doSelect(criteria, con);
550                  }
551              }
552          }
553          lastCustomersCriteria = criteria;
554
555          return collCustomers;
556            }
557
558                                                 
559               
560                     
561                     
562                                 
563                                                               
564                                         
565                     
566                     
567           
568     /**
569      * If this collection has already been initialized with
570      * an identical criteria, it returns the collection.
571      * Otherwise if this Language is new, it will return
572      * an empty collection; or if this Language has previously
573      * been saved, it will retrieve related Customers from storage.
574      *
575      * This method is protected by default in order to keep the public
576      * api reasonable. You can provide public methods for those you
577      * actually need in Language.
578      */

579     protected List JavaDoc getCustomersJoinCustomerCategory(Criteria criteria)
580         throws TorqueException
581     {
582                     if (collCustomers == null)
583         {
584             if (isNew())
585             {
586                collCustomers = new ArrayList JavaDoc();
587             }
588             else
589             {
590                               criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
591                               collCustomers = CustomerPeer.doSelectJoinCustomerCategory(criteria);
592             }
593         }
594         else
595         {
596             // the following code is to determine if a new query is
597
// called for. If the criteria is the same as the last
598
// one, just return the collection.
599

600                         criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
601                                     if (!lastCustomersCriteria.equals(criteria))
602             {
603                 collCustomers = CustomerPeer.doSelectJoinCustomerCategory(criteria);
604             }
605         }
606         lastCustomersCriteria = criteria;
607
608         return collCustomers;
609                 }
610                   
611                     
612                     
613                                 
614                                                               
615                                         
616                     
617                     
618           
619     /**
620      * If this collection has already been initialized with
621      * an identical criteria, it returns the collection.
622      * Otherwise if this Language is new, it will return
623      * an empty collection; or if this Language has previously
624      * been saved, it will retrieve related Customers from storage.
625      *
626      * This method is protected by default in order to keep the public
627      * api reasonable. You can provide public methods for those you
628      * actually need in Language.
629      */

630     protected List JavaDoc getCustomersJoinCountry(Criteria criteria)
631         throws TorqueException
632     {
633                     if (collCustomers == null)
634         {
635             if (isNew())
636             {
637                collCustomers = new ArrayList JavaDoc();
638             }
639             else
640             {
641                               criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
642                               collCustomers = CustomerPeer.doSelectJoinCountry(criteria);
643             }
644         }
645         else
646         {
647             // the following code is to determine if a new query is
648
// called for. If the criteria is the same as the last
649
// one, just return the collection.
650

651                         criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
652                                     if (!lastCustomersCriteria.equals(criteria))
653             {
654                 collCustomers = CustomerPeer.doSelectJoinCountry(criteria);
655             }
656         }
657         lastCustomersCriteria = criteria;
658
659         return collCustomers;
660                 }
661                   
662                     
663                     
664                                 
665                                                               
666                                         
667                     
668                     
669           
670     /**
671      * If this collection has already been initialized with
672      * an identical criteria, it returns the collection.
673      * Otherwise if this Language is new, it will return
674      * an empty collection; or if this Language has previously
675      * been saved, it will retrieve related Customers from storage.
676      *
677      * This method is protected by default in order to keep the public
678      * api reasonable. You can provide public methods for those you
679      * actually need in Language.
680      */

681     protected List JavaDoc getCustomersJoinRegion(Criteria criteria)
682         throws TorqueException
683     {
684                     if (collCustomers == null)
685         {
686             if (isNew())
687             {
688                collCustomers = new ArrayList JavaDoc();
689             }
690             else
691             {
692                               criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
693                               collCustomers = CustomerPeer.doSelectJoinRegion(criteria);
694             }
695         }
696         else
697         {
698             // the following code is to determine if a new query is
699
// called for. If the criteria is the same as the last
700
// one, just return the collection.
701

702                         criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
703                                     if (!lastCustomersCriteria.equals(criteria))
704             {
705                 collCustomers = CustomerPeer.doSelectJoinRegion(criteria);
706             }
707         }
708         lastCustomersCriteria = criteria;
709
710         return collCustomers;
711                 }
712                   
713                     
714                               
715                                 
716                                                               
717                                         
718                     
719                     
720           
721     /**
722      * If this collection has already been initialized with
723      * an identical criteria, it returns the collection.
724      * Otherwise if this Language is new, it will return
725      * an empty collection; or if this Language has previously
726      * been saved, it will retrieve related Customers from storage.
727      *
728      * This method is protected by default in order to keep the public
729      * api reasonable. You can provide public methods for those you
730      * actually need in Language.
731      */

732     protected List JavaDoc getCustomersJoinLanguage(Criteria criteria)
733         throws TorqueException
734     {
735                     if (collCustomers == null)
736         {
737             if (isNew())
738             {
739                collCustomers = new ArrayList JavaDoc();
740             }
741             else
742             {
743                               criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
744                               collCustomers = CustomerPeer.doSelectJoinLanguage(criteria);
745             }
746         }
747         else
748         {
749             // the following code is to determine if a new query is
750
// called for. If the criteria is the same as the last
751
// one, just return the collection.
752

753                         criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
754                                     if (!lastCustomersCriteria.equals(criteria))
755             {
756                 collCustomers = CustomerPeer.doSelectJoinLanguage(criteria);
757             }
758         }
759         lastCustomersCriteria = criteria;
760
761         return collCustomers;
762                 }
763                   
764                     
765                     
766                                 
767                                                               
768                                         
769                     
770                     
771           
772     /**
773      * If this collection has already been initialized with
774      * an identical criteria, it returns the collection.
775      * Otherwise if this Language is new, it will return
776      * an empty collection; or if this Language has previously
777      * been saved, it will retrieve related Customers from storage.
778      *
779      * This method is protected by default in order to keep the public
780      * api reasonable. You can provide public methods for those you
781      * actually need in Language.
782      */

783     protected List JavaDoc getCustomersJoinEducationCategory(Criteria criteria)
784         throws TorqueException
785     {
786                     if (collCustomers == null)
787         {
788             if (isNew())
789             {
790                collCustomers = new ArrayList JavaDoc();
791             }
792             else
793             {
794                               criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
795                               collCustomers = CustomerPeer.doSelectJoinEducationCategory(criteria);
796             }
797         }
798         else
799         {
800             // the following code is to determine if a new query is
801
// called for. If the criteria is the same as the last
802
// one, just return the collection.
803

804                         criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
805                                     if (!lastCustomersCriteria.equals(criteria))
806             {
807                 collCustomers = CustomerPeer.doSelectJoinEducationCategory(criteria);
808             }
809         }
810         lastCustomersCriteria = criteria;
811
812         return collCustomers;
813                 }
814                   
815                     
816                     
817                                 
818                                                               
819                                         
820                     
821                     
822           
823     /**
824      * If this collection has already been initialized with
825      * an identical criteria, it returns the collection.
826      * Otherwise if this Language is new, it will return
827      * an empty collection; or if this Language has previously
828      * been saved, it will retrieve related Customers from storage.
829      *
830      * This method is protected by default in order to keep the public
831      * api reasonable. You can provide public methods for those you
832      * actually need in Language.
833      */

834     protected List JavaDoc getCustomersJoinHouseholdCategory(Criteria criteria)
835         throws TorqueException
836     {
837                     if (collCustomers == null)
838         {
839             if (isNew())
840             {
841                collCustomers = new ArrayList JavaDoc();
842             }
843             else
844             {
845                               criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
846                               collCustomers = CustomerPeer.doSelectJoinHouseholdCategory(criteria);
847             }
848         }
849         else
850         {
851             // the following code is to determine if a new query is
852
// called for. If the criteria is the same as the last
853
// one, just return the collection.
854

855                         criteria.add(CustomerPeer.LANGUAGE_ID, getLanguageId());
856                                     if (!lastCustomersCriteria.equals(criteria))
857             {
858                 collCustomers = CustomerPeer.doSelectJoinHouseholdCategory(criteria);
859             }
860         }
861         lastCustomersCriteria = criteria;
862
863         return collCustomers;
864                 }
865                             
866
867
868                                   
869             
870           /**
871      * Collection to store aggregation of collNewslettersRelatedByCustLanguageId
872      */

873     protected List JavaDoc collNewslettersRelatedByCustLanguageId;
874
875     /**
876      * Temporary storage of collNewslettersRelatedByCustLanguageId to save a possible db hit in
877      * the event objects are add to the collection, but the
878      * complete collection is never requested.
879      */

880     protected void initNewslettersRelatedByCustLanguageId()
881     {
882         if (collNewslettersRelatedByCustLanguageId == null)
883         {
884             collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
885         }
886     }
887
888     /**
889      * Method called to associate a Newsletter object to this object
890      * through the Newsletter foreign key attribute
891      *
892      * @param l Newsletter
893      * @throws TorqueException
894      */

895     public void addNewsletterRelatedByCustLanguageId(Newsletter l) throws TorqueException
896     {
897         getNewslettersRelatedByCustLanguageId().add(l);
898         l.setLanguageRelatedByCustLanguageId((Language) this);
899     }
900
901     /**
902      * The criteria used to select the current contents of collNewslettersRelatedByCustLanguageId
903      */

904     private Criteria lastNewslettersRelatedByCustLanguageIdCriteria = null;
905       
906     /**
907      * If this collection has already been initialized, returns
908      * the collection. Otherwise returns the results of
909      * getNewslettersRelatedByCustLanguageId(new Criteria())
910      *
911      * @throws TorqueException
912      */

913     public List JavaDoc getNewslettersRelatedByCustLanguageId() throws TorqueException
914     {
915               if (collNewslettersRelatedByCustLanguageId == null)
916         {
917             collNewslettersRelatedByCustLanguageId = getNewslettersRelatedByCustLanguageId(new Criteria(10));
918         }
919         return collNewslettersRelatedByCustLanguageId;
920           }
921
922     /**
923      * If this collection has already been initialized with
924      * an identical criteria, it returns the collection.
925      * Otherwise if this Language has previously
926      * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
927      * If this Language is new, it will return
928      * an empty collection or the current collection, the criteria
929      * is ignored on a new object.
930      *
931      * @throws TorqueException
932      */

933     public List JavaDoc getNewslettersRelatedByCustLanguageId(Criteria criteria) throws TorqueException
934     {
935               if (collNewslettersRelatedByCustLanguageId == null)
936         {
937             if (isNew())
938             {
939                collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
940             }
941             else
942             {
943                         criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId() );
944                         collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelect(criteria);
945             }
946         }
947         else
948         {
949             // criteria has no effect for a new object
950
if (!isNew())
951             {
952                 // the following code is to determine if a new query is
953
// called for. If the criteria is the same as the last
954
// one, just return the collection.
955
criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
956                             if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
957                 {
958                     collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelect(criteria);
959                 }
960             }
961         }
962         lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
963
964         return collNewslettersRelatedByCustLanguageId;
965           }
966
967     /**
968      * If this collection has already been initialized, returns
969      * the collection. Otherwise returns the results of
970      * getNewslettersRelatedByCustLanguageId(new Criteria(),Connection)
971      * This method takes in the Connection also as input so that
972      * referenced objects can also be obtained using a Connection
973      * that is taken as input
974      */

975     public List JavaDoc getNewslettersRelatedByCustLanguageId(Connection JavaDoc con) throws TorqueException
976     {
977               if (collNewslettersRelatedByCustLanguageId == null)
978         {
979             collNewslettersRelatedByCustLanguageId = getNewslettersRelatedByCustLanguageId(new Criteria(10), con);
980         }
981         return collNewslettersRelatedByCustLanguageId;
982           }
983
984     /**
985      * If this collection has already been initialized with
986      * an identical criteria, it returns the collection.
987      * Otherwise if this Language has previously
988      * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
989      * If this Language is new, it will return
990      * an empty collection or the current collection, the criteria
991      * is ignored on a new object.
992      * This method takes in the Connection also as input so that
993      * referenced objects can also be obtained using a Connection
994      * that is taken as input
995      */

996     public List JavaDoc getNewslettersRelatedByCustLanguageId(Criteria criteria, Connection JavaDoc con)
997             throws TorqueException
998     {
999               if (collNewslettersRelatedByCustLanguageId == null)
1000        {
1001            if (isNew())
1002            {
1003               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1004            }
1005            else
1006            {
1007                         criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1008                         collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelect(criteria, con);
1009             }
1010         }
1011         else
1012         {
1013             // criteria has no effect for a new object
1014
if (!isNew())
1015             {
1016                 // the following code is to determine if a new query is
1017
// called for. If the criteria is the same as the last
1018
// one, just return the collection.
1019
criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1020                             if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1021                 {
1022                     collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelect(criteria, con);
1023                 }
1024             }
1025         }
1026         lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1027
1028         return collNewslettersRelatedByCustLanguageId;
1029           }
1030
1031                                                            
1032              
1033                    
1034                    
1035                                
1036                                                              
1037                                        
1038                    
1039                                
1040          
1041    /**
1042     * If this collection has already been initialized with
1043     * an identical criteria, it returns the collection.
1044     * Otherwise if this Language is new, it will return
1045     * an empty collection; or if this Language has previously
1046     * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
1047     *
1048     * This method is protected by default in order to keep the public
1049     * api reasonable. You can provide public methods for those you
1050     * actually need in Language.
1051     */

1052    protected List JavaDoc getNewslettersRelatedByCustLanguageIdJoinCustomerCategory(Criteria criteria)
1053        throws TorqueException
1054    {
1055                    if (collNewslettersRelatedByCustLanguageId == null)
1056        {
1057            if (isNew())
1058            {
1059               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1060            }
1061            else
1062            {
1063                              criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1064                              collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
1065            }
1066        }
1067        else
1068        {
1069            // the following code is to determine if a new query is
1070
// called for. If the criteria is the same as the last
1071
// one, just return the collection.
1072

1073                        criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1074                                    if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1075            {
1076                collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
1077            }
1078        }
1079        lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1080
1081        return collNewslettersRelatedByCustLanguageId;
1082                }
1083                  
1084                    
1085                    
1086                                            
1087                                                                          
1088                                        
1089                    
1090                                
1091          
1092    /**
1093     * If this collection has already been initialized with
1094     * an identical criteria, it returns the collection.
1095     * Otherwise if this Language is new, it will return
1096     * an empty collection; or if this Language has previously
1097     * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
1098     *
1099     * This method is protected by default in order to keep the public
1100     * api reasonable. You can provide public methods for those you
1101     * actually need in Language.
1102     */

1103    protected List JavaDoc getNewslettersRelatedByCustLanguageIdJoinProjectRelatedByProjectId(Criteria criteria)
1104        throws TorqueException
1105    {
1106                    if (collNewslettersRelatedByCustLanguageId == null)
1107        {
1108            if (isNew())
1109            {
1110               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1111            }
1112            else
1113            {
1114                              criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1115                              collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
1116            }
1117        }
1118        else
1119        {
1120            // the following code is to determine if a new query is
1121
// called for. If the criteria is the same as the last
1122
// one, just return the collection.
1123

1124                        criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1125                                    if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1126            {
1127                collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
1128            }
1129        }
1130        lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1131
1132        return collNewslettersRelatedByCustLanguageId;
1133                }
1134                  
1135                    
1136                    
1137                                            
1138                                                                          
1139                                        
1140                    
1141                                
1142          
1143    /**
1144     * If this collection has already been initialized with
1145     * an identical criteria, it returns the collection.
1146     * Otherwise if this Language is new, it will return
1147     * an empty collection; or if this Language has previously
1148     * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
1149     *
1150     * This method is protected by default in order to keep the public
1151     * api reasonable. You can provide public methods for those you
1152     * actually need in Language.
1153     */

1154    protected List JavaDoc getNewslettersRelatedByCustLanguageIdJoinProductRelatedByProductId(Criteria criteria)
1155        throws TorqueException
1156    {
1157                    if (collNewslettersRelatedByCustLanguageId == null)
1158        {
1159            if (isNew())
1160            {
1161               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1162            }
1163            else
1164            {
1165                              criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1166                              collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
1167            }
1168        }
1169        else
1170        {
1171            // the following code is to determine if a new query is
1172
// called for. If the criteria is the same as the last
1173
// one, just return the collection.
1174

1175                        criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1176                                    if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1177            {
1178                collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
1179            }
1180        }
1181        lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1182
1183        return collNewslettersRelatedByCustLanguageId;
1184                }
1185                  
1186                    
1187                    
1188                                            
1189                                                                          
1190                                        
1191                    
1192                                
1193          
1194    /**
1195     * If this collection has already been initialized with
1196     * an identical criteria, it returns the collection.
1197     * Otherwise if this Language is new, it will return
1198     * an empty collection; or if this Language has previously
1199     * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
1200     *
1201     * This method is protected by default in order to keep the public
1202     * api reasonable. You can provide public methods for those you
1203     * actually need in Language.
1204     */

1205    protected List JavaDoc getNewslettersRelatedByCustLanguageIdJoinProjectRelatedByRelProjectId(Criteria criteria)
1206        throws TorqueException
1207    {
1208                    if (collNewslettersRelatedByCustLanguageId == null)
1209        {
1210            if (isNew())
1211            {
1212               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1213            }
1214            else
1215            {
1216                              criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1217                              collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
1218            }
1219        }
1220        else
1221        {
1222            // the following code is to determine if a new query is
1223
// called for. If the criteria is the same as the last
1224
// one, just return the collection.
1225

1226                        criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1227                                    if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1228            {
1229                collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
1230            }
1231        }
1232        lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1233
1234        return collNewslettersRelatedByCustLanguageId;
1235                }
1236                  
1237                    
1238                    
1239                                            
1240                                                                          
1241                                        
1242                    
1243                                
1244          
1245    /**
1246     * If this collection has already been initialized with
1247     * an identical criteria, it returns the collection.
1248     * Otherwise if this Language is new, it will return
1249     * an empty collection; or if this Language has previously
1250     * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
1251     *
1252     * This method is protected by default in order to keep the public
1253     * api reasonable. You can provide public methods for those you
1254     * actually need in Language.
1255     */

1256    protected List JavaDoc getNewslettersRelatedByCustLanguageIdJoinProductRelatedByRelProductId(Criteria criteria)
1257        throws TorqueException
1258    {
1259                    if (collNewslettersRelatedByCustLanguageId == null)
1260        {
1261            if (isNew())
1262            {
1263               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1264            }
1265            else
1266            {
1267                              criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1268                              collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
1269            }
1270        }
1271        else
1272        {
1273            // the following code is to determine if a new query is
1274
// called for. If the criteria is the same as the last
1275
// one, just return the collection.
1276

1277                        criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1278                                    if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1279            {
1280                collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
1281            }
1282        }
1283        lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1284
1285        return collNewslettersRelatedByCustLanguageId;
1286                }
1287                  
1288                    
1289                    
1290                                
1291                                                              
1292                                        
1293                    
1294                                
1295          
1296    /**
1297     * If this collection has already been initialized with
1298     * an identical criteria, it returns the collection.
1299     * Otherwise if this Language is new, it will return
1300     * an empty collection; or if this Language has previously
1301     * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
1302     *
1303     * This method is protected by default in order to keep the public
1304     * api reasonable. You can provide public methods for those you
1305     * actually need in Language.
1306     */

1307    protected List JavaDoc getNewslettersRelatedByCustLanguageIdJoinCountry(Criteria criteria)
1308        throws TorqueException
1309    {
1310                    if (collNewslettersRelatedByCustLanguageId == null)
1311        {
1312            if (isNew())
1313            {
1314               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1315            }
1316            else
1317            {
1318                              criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1319                              collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinCountry(criteria);
1320            }
1321        }
1322        else
1323        {
1324            // the following code is to determine if a new query is
1325
// called for. If the criteria is the same as the last
1326
// one, just return the collection.
1327

1328                        criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1329                                    if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1330            {
1331                collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinCountry(criteria);
1332            }
1333        }
1334        lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1335
1336        return collNewslettersRelatedByCustLanguageId;
1337                }
1338                  
1339                    
1340                              
1341                                            
1342                                                                          
1343                                        
1344                    
1345                                            
1346                  
1347                    
1348                              
1349                                            
1350                                                                          
1351                                        
1352                    
1353                                
1354          
1355    /**
1356     * If this collection has already been initialized with
1357     * an identical criteria, it returns the collection.
1358     * Otherwise if this Language is new, it will return
1359     * an empty collection; or if this Language has previously
1360     * been saved, it will retrieve related NewslettersRelatedByCustLanguageId from storage.
1361     *
1362     * This method is protected by default in order to keep the public
1363     * api reasonable. You can provide public methods for those you
1364     * actually need in Language.
1365     */

1366    protected List JavaDoc getNewslettersRelatedByCustLanguageIdJoinLanguageRelatedByLanguageId(Criteria criteria)
1367        throws TorqueException
1368    {
1369                    if (collNewslettersRelatedByCustLanguageId == null)
1370        {
1371            if (isNew())
1372            {
1373               collNewslettersRelatedByCustLanguageId = new ArrayList JavaDoc();
1374            }
1375            else
1376            {
1377                              criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1378                              collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
1379            }
1380        }
1381        else
1382        {
1383            // the following code is to determine if a new query is
1384
// called for. If the criteria is the same as the last
1385
// one, just return the collection.
1386

1387                        criteria.add(NewsletterPeer.CUST_LANGUAGE_ID, getLanguageId());
1388                                    if (!lastNewslettersRelatedByCustLanguageIdCriteria.equals(criteria))
1389            {
1390                collNewslettersRelatedByCustLanguageId = NewsletterPeer.doSelectJoinLanguageRelatedByLanguageId(criteria);
1391            }
1392        }
1393        lastNewslettersRelatedByCustLanguageIdCriteria = criteria;
1394
1395        return collNewslettersRelatedByCustLanguageId;
1396                }
1397                            
1398
1399
1400                                  
1401            
1402          /**
1403     * Collection to store aggregation of collNewslettersRelatedByLanguageId
1404     */

1405    protected List JavaDoc collNewslettersRelatedByLanguageId;
1406
1407    /**
1408     * Temporary storage of collNewslettersRelatedByLanguageId to save a possible db hit in
1409     * the event objects are add to the collection, but the
1410     * complete collection is never requested.
1411     */

1412    protected void initNewslettersRelatedByLanguageId()
1413    {
1414        if (collNewslettersRelatedByLanguageId == null)
1415        {
1416            collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1417        }
1418    }
1419
1420    /**
1421     * Method called to associate a Newsletter object to this object
1422     * through the Newsletter foreign key attribute
1423     *
1424     * @param l Newsletter
1425     * @throws TorqueException
1426     */

1427    public void addNewsletterRelatedByLanguageId(Newsletter l) throws TorqueException
1428    {
1429        getNewslettersRelatedByLanguageId().add(l);
1430        l.setLanguageRelatedByLanguageId((Language) this);
1431    }
1432
1433    /**
1434     * The criteria used to select the current contents of collNewslettersRelatedByLanguageId
1435     */

1436    private Criteria lastNewslettersRelatedByLanguageIdCriteria = null;
1437      
1438    /**
1439     * If this collection has already been initialized, returns
1440     * the collection. Otherwise returns the results of
1441     * getNewslettersRelatedByLanguageId(new Criteria())
1442     *
1443     * @throws TorqueException
1444     */

1445    public List JavaDoc getNewslettersRelatedByLanguageId() throws TorqueException
1446    {
1447              if (collNewslettersRelatedByLanguageId == null)
1448        {
1449            collNewslettersRelatedByLanguageId = getNewslettersRelatedByLanguageId(new Criteria(10));
1450        }
1451        return collNewslettersRelatedByLanguageId;
1452          }
1453
1454    /**
1455     * If this collection has already been initialized with
1456     * an identical criteria, it returns the collection.
1457     * Otherwise if this Language has previously
1458     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1459     * If this Language is new, it will return
1460     * an empty collection or the current collection, the criteria
1461     * is ignored on a new object.
1462     *
1463     * @throws TorqueException
1464     */

1465    public List JavaDoc getNewslettersRelatedByLanguageId(Criteria criteria) throws TorqueException
1466    {
1467              if (collNewslettersRelatedByLanguageId == null)
1468        {
1469            if (isNew())
1470            {
1471               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1472            }
1473            else
1474            {
1475                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId() );
1476                        collNewslettersRelatedByLanguageId = NewsletterPeer.doSelect(criteria);
1477            }
1478        }
1479        else
1480        {
1481            // criteria has no effect for a new object
1482
if (!isNew())
1483            {
1484                // the following code is to determine if a new query is
1485
// called for. If the criteria is the same as the last
1486
// one, just return the collection.
1487
criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1488                            if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1489                {
1490                    collNewslettersRelatedByLanguageId = NewsletterPeer.doSelect(criteria);
1491                }
1492            }
1493        }
1494        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1495
1496        return collNewslettersRelatedByLanguageId;
1497          }
1498
1499    /**
1500     * If this collection has already been initialized, returns
1501     * the collection. Otherwise returns the results of
1502     * getNewslettersRelatedByLanguageId(new Criteria(),Connection)
1503     * This method takes in the Connection also as input so that
1504     * referenced objects can also be obtained using a Connection
1505     * that is taken as input
1506     */

1507    public List JavaDoc getNewslettersRelatedByLanguageId(Connection JavaDoc con) throws TorqueException
1508    {
1509              if (collNewslettersRelatedByLanguageId == null)
1510        {
1511            collNewslettersRelatedByLanguageId = getNewslettersRelatedByLanguageId(new Criteria(10), con);
1512        }
1513        return collNewslettersRelatedByLanguageId;
1514          }
1515
1516    /**
1517     * If this collection has already been initialized with
1518     * an identical criteria, it returns the collection.
1519     * Otherwise if this Language has previously
1520     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1521     * If this Language is new, it will return
1522     * an empty collection or the current collection, the criteria
1523     * is ignored on a new object.
1524     * This method takes in the Connection also as input so that
1525     * referenced objects can also be obtained using a Connection
1526     * that is taken as input
1527     */

1528    public List JavaDoc getNewslettersRelatedByLanguageId(Criteria criteria, Connection JavaDoc con)
1529            throws TorqueException
1530    {
1531              if (collNewslettersRelatedByLanguageId == null)
1532        {
1533            if (isNew())
1534            {
1535               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1536            }
1537            else
1538            {
1539                         criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1540                         collNewslettersRelatedByLanguageId = NewsletterPeer.doSelect(criteria, con);
1541             }
1542         }
1543         else
1544         {
1545             // criteria has no effect for a new object
1546
if (!isNew())
1547             {
1548                 // the following code is to determine if a new query is
1549
// called for. If the criteria is the same as the last
1550
// one, just return the collection.
1551
criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1552                             if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1553                 {
1554                     collNewslettersRelatedByLanguageId = NewsletterPeer.doSelect(criteria, con);
1555                 }
1556             }
1557         }
1558         lastNewslettersRelatedByLanguageIdCriteria = criteria;
1559
1560         return collNewslettersRelatedByLanguageId;
1561           }
1562
1563                                                            
1564              
1565                    
1566                    
1567                                
1568                                                              
1569                                        
1570                    
1571                                
1572          
1573    /**
1574     * If this collection has already been initialized with
1575     * an identical criteria, it returns the collection.
1576     * Otherwise if this Language is new, it will return
1577     * an empty collection; or if this Language has previously
1578     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1579     *
1580     * This method is protected by default in order to keep the public
1581     * api reasonable. You can provide public methods for those you
1582     * actually need in Language.
1583     */

1584    protected List JavaDoc getNewslettersRelatedByLanguageIdJoinCustomerCategory(Criteria criteria)
1585        throws TorqueException
1586    {
1587                    if (collNewslettersRelatedByLanguageId == null)
1588        {
1589            if (isNew())
1590            {
1591               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1592            }
1593            else
1594            {
1595                              criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1596                              collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
1597            }
1598        }
1599        else
1600        {
1601            // the following code is to determine if a new query is
1602
// called for. If the criteria is the same as the last
1603
// one, just return the collection.
1604

1605                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1606                                    if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1607            {
1608                collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinCustomerCategory(criteria);
1609            }
1610        }
1611        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1612
1613        return collNewslettersRelatedByLanguageId;
1614                }
1615                  
1616                    
1617                    
1618                                            
1619                                                                          
1620                                        
1621                    
1622                                
1623          
1624    /**
1625     * If this collection has already been initialized with
1626     * an identical criteria, it returns the collection.
1627     * Otherwise if this Language is new, it will return
1628     * an empty collection; or if this Language has previously
1629     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1630     *
1631     * This method is protected by default in order to keep the public
1632     * api reasonable. You can provide public methods for those you
1633     * actually need in Language.
1634     */

1635    protected List JavaDoc getNewslettersRelatedByLanguageIdJoinProjectRelatedByProjectId(Criteria criteria)
1636        throws TorqueException
1637    {
1638                    if (collNewslettersRelatedByLanguageId == null)
1639        {
1640            if (isNew())
1641            {
1642               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1643            }
1644            else
1645            {
1646                              criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1647                              collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
1648            }
1649        }
1650        else
1651        {
1652            // the following code is to determine if a new query is
1653
// called for. If the criteria is the same as the last
1654
// one, just return the collection.
1655

1656                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1657                                    if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1658            {
1659                collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByProjectId(criteria);
1660            }
1661        }
1662        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1663
1664        return collNewslettersRelatedByLanguageId;
1665                }
1666                  
1667                    
1668                    
1669                                            
1670                                                                          
1671                                        
1672                    
1673                                
1674          
1675    /**
1676     * If this collection has already been initialized with
1677     * an identical criteria, it returns the collection.
1678     * Otherwise if this Language is new, it will return
1679     * an empty collection; or if this Language has previously
1680     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1681     *
1682     * This method is protected by default in order to keep the public
1683     * api reasonable. You can provide public methods for those you
1684     * actually need in Language.
1685     */

1686    protected List JavaDoc getNewslettersRelatedByLanguageIdJoinProductRelatedByProductId(Criteria criteria)
1687        throws TorqueException
1688    {
1689                    if (collNewslettersRelatedByLanguageId == null)
1690        {
1691            if (isNew())
1692            {
1693               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1694            }
1695            else
1696            {
1697                              criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1698                              collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
1699            }
1700        }
1701        else
1702        {
1703            // the following code is to determine if a new query is
1704
// called for. If the criteria is the same as the last
1705
// one, just return the collection.
1706

1707                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1708                                    if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1709            {
1710                collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProductRelatedByProductId(criteria);
1711            }
1712        }
1713        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1714
1715        return collNewslettersRelatedByLanguageId;
1716                }
1717                  
1718                    
1719                    
1720                                            
1721                                                                          
1722                                        
1723                    
1724                                
1725          
1726    /**
1727     * If this collection has already been initialized with
1728     * an identical criteria, it returns the collection.
1729     * Otherwise if this Language is new, it will return
1730     * an empty collection; or if this Language has previously
1731     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1732     *
1733     * This method is protected by default in order to keep the public
1734     * api reasonable. You can provide public methods for those you
1735     * actually need in Language.
1736     */

1737    protected List JavaDoc getNewslettersRelatedByLanguageIdJoinProjectRelatedByRelProjectId(Criteria criteria)
1738        throws TorqueException
1739    {
1740                    if (collNewslettersRelatedByLanguageId == null)
1741        {
1742            if (isNew())
1743            {
1744               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1745            }
1746            else
1747            {
1748                              criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1749                              collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
1750            }
1751        }
1752        else
1753        {
1754            // the following code is to determine if a new query is
1755
// called for. If the criteria is the same as the last
1756
// one, just return the collection.
1757

1758                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1759                                    if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1760            {
1761                collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProjectRelatedByRelProjectId(criteria);
1762            }
1763        }
1764        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1765
1766        return collNewslettersRelatedByLanguageId;
1767                }
1768                  
1769                    
1770                    
1771                                            
1772                                                                          
1773                                        
1774                    
1775                                
1776          
1777    /**
1778     * If this collection has already been initialized with
1779     * an identical criteria, it returns the collection.
1780     * Otherwise if this Language is new, it will return
1781     * an empty collection; or if this Language has previously
1782     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1783     *
1784     * This method is protected by default in order to keep the public
1785     * api reasonable. You can provide public methods for those you
1786     * actually need in Language.
1787     */

1788    protected List JavaDoc getNewslettersRelatedByLanguageIdJoinProductRelatedByRelProductId(Criteria criteria)
1789        throws TorqueException
1790    {
1791                    if (collNewslettersRelatedByLanguageId == null)
1792        {
1793            if (isNew())
1794            {
1795               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1796            }
1797            else
1798            {
1799                              criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1800                              collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
1801            }
1802        }
1803        else
1804        {
1805            // the following code is to determine if a new query is
1806
// called for. If the criteria is the same as the last
1807
// one, just return the collection.
1808

1809                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1810                                    if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1811            {
1812                collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinProductRelatedByRelProductId(criteria);
1813            }
1814        }
1815        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1816
1817        return collNewslettersRelatedByLanguageId;
1818                }
1819                  
1820                    
1821                    
1822                                
1823                                                              
1824                                        
1825                    
1826                                
1827          
1828    /**
1829     * If this collection has already been initialized with
1830     * an identical criteria, it returns the collection.
1831     * Otherwise if this Language is new, it will return
1832     * an empty collection; or if this Language has previously
1833     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1834     *
1835     * This method is protected by default in order to keep the public
1836     * api reasonable. You can provide public methods for those you
1837     * actually need in Language.
1838     */

1839    protected List JavaDoc getNewslettersRelatedByLanguageIdJoinCountry(Criteria criteria)
1840        throws TorqueException
1841    {
1842                    if (collNewslettersRelatedByLanguageId == null)
1843        {
1844            if (isNew())
1845            {
1846               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1847            }
1848            else
1849            {
1850                              criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1851                              collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinCountry(criteria);
1852            }
1853        }
1854        else
1855        {
1856            // the following code is to determine if a new query is
1857
// called for. If the criteria is the same as the last
1858
// one, just return the collection.
1859

1860                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1861                                    if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1862            {
1863                collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinCountry(criteria);
1864            }
1865        }
1866        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1867
1868        return collNewslettersRelatedByLanguageId;
1869                }
1870                  
1871                    
1872                              
1873                                            
1874                                                                          
1875                                        
1876                    
1877                                
1878          
1879    /**
1880     * If this collection has already been initialized with
1881     * an identical criteria, it returns the collection.
1882     * Otherwise if this Language is new, it will return
1883     * an empty collection; or if this Language has previously
1884     * been saved, it will retrieve related NewslettersRelatedByLanguageId from storage.
1885     *
1886     * This method is protected by default in order to keep the public
1887     * api reasonable. You can provide public methods for those you
1888     * actually need in Language.
1889     */

1890    protected List JavaDoc getNewslettersRelatedByLanguageIdJoinLanguageRelatedByCustLanguageId(Criteria criteria)
1891        throws TorqueException
1892    {
1893                    if (collNewslettersRelatedByLanguageId == null)
1894        {
1895            if (isNew())
1896            {
1897               collNewslettersRelatedByLanguageId = new ArrayList JavaDoc();
1898            }
1899            else
1900            {
1901                              criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1902                              collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
1903            }
1904        }
1905        else
1906        {
1907            // the following code is to determine if a new query is
1908
// called for. If the criteria is the same as the last
1909
// one, just return the collection.
1910

1911                        criteria.add(NewsletterPeer.LANGUAGE_ID, getLanguageId());
1912                                    if (!lastNewslettersRelatedByLanguageIdCriteria.equals(criteria))
1913            {
1914                collNewslettersRelatedByLanguageId = NewsletterPeer.doSelectJoinLanguageRelatedByCustLanguageId(criteria);
1915            }
1916        }
1917        lastNewslettersRelatedByLanguageIdCriteria = criteria;
1918
1919        return collNewslettersRelatedByLanguageId;
1920                }
1921                  
1922                    
1923                              
1924                                            
1925                                                                          
1926                                        
1927                    
1928                                            
1929                            
1930
1931
1932          
1933    private static List JavaDoc fieldNames = null;
1934
1935    /**
1936     * Generate a list of field names.
1937     *
1938     * @return a list of field names
1939     */

1940    public static synchronized List JavaDoc getFieldNames()
1941    {
1942        if (fieldNames == null)
1943        {
1944            fieldNames = new ArrayList JavaDoc();
1945              fieldNames.add("LanguageId");
1946              fieldNames.add("LanguageName");
1947              fieldNames.add("LanguageCode");
1948              fieldNames = Collections.unmodifiableList(fieldNames);
1949        }
1950        return fieldNames;
1951    }
1952
1953    /**
1954     * Retrieves a field from the object by name passed in as a String.
1955     *
1956     * @param name field name
1957     * @return value
1958     */

1959    public Object JavaDoc getByName(String JavaDoc name)
1960    {
1961          if (name.equals("LanguageId"))
1962        {
1963                return new Integer JavaDoc(getLanguageId());
1964            }
1965          if (name.equals("LanguageName"))
1966        {
1967                return getLanguageName();
1968            }
1969          if (name.equals("LanguageCode"))
1970        {
1971                return getLanguageCode();
1972            }
1973          return null;
1974    }
1975    
1976    /**
1977     * Retrieves a field from the object by name passed in
1978     * as a String. The String must be one of the static
1979     * Strings defined in this Class' Peer.
1980     *
1981     * @param name peer name
1982     * @return value
1983     */

1984    public Object JavaDoc getByPeerName(String JavaDoc name)
1985    {
1986          if (name.equals(LanguagePeer.LANGUAGE_ID))
1987        {
1988                return new Integer JavaDoc(getLanguageId());
1989            }
1990          if (name.equals(LanguagePeer.LANGUAGE_NAME))
1991        {
1992                return getLanguageName();
1993            }
1994          if (name.equals(LanguagePeer.LANGUAGE_CODE))
1995        {
1996                return getLanguageCode();
1997            }
1998          return null;
1999    }
2000
2001    /**
2002     * Retrieves a field from the object by Position as specified
2003     * in the xml schema. Zero-based.
2004     *
2005     * @param pos position in xml schema
2006     * @return value
2007     */

2008    public Object JavaDoc getByPosition(int pos)
2009    {
2010            if (pos == 0)
2011        {
2012                return new Integer JavaDoc(getLanguageId());
2013            }
2014              if (pos == 1)
2015        {
2016                return getLanguageName();
2017            }
2018              if (pos == 2)
2019        {
2020                return getLanguageCode();
2021            }
2022              return null;
2023    }
2024     
2025    /**
2026     * Stores the object in the database. If the object is new,
2027     * it inserts it; otherwise an update is performed.
2028     *
2029     * @throws Exception
2030     */

2031    public void save() throws Exception JavaDoc
2032    {
2033          save(LanguagePeer.getMapBuilder()
2034                .getDatabaseMap().getName());
2035      }
2036
2037    /**
2038     * Stores the object in the database. If the object is new,
2039     * it inserts it; otherwise an update is performed.
2040       * Note: this code is here because the method body is
2041     * auto-generated conditionally and therefore needs to be
2042     * in this file instead of in the super class, BaseObject.
2043       *
2044     * @param dbName
2045     * @throws TorqueException
2046     */

2047    public void save(String JavaDoc dbName) throws TorqueException
2048    {
2049        Connection JavaDoc con = null;
2050          try
2051        {
2052            con = Transaction.begin(dbName);
2053            save(con);
2054            Transaction.commit(con);
2055        }
2056        catch(TorqueException e)
2057        {
2058            Transaction.safeRollback(con);
2059            throw e;
2060        }
2061      }
2062
2063      /** flag to prevent endless save loop, if this object is referenced
2064        by another object which falls in this transaction. */

2065    private boolean alreadyInSave = false;
2066      /**
2067     * Stores the object in the database. If the object is new,
2068     * it inserts it; otherwise an update is performed. This method
2069     * is meant to be used as part of a transaction, otherwise use
2070     * the save() method and the connection details will be handled
2071     * internally
2072     *
2073     * @param con
2074     * @throws TorqueException
2075     */

2076    public void save(Connection JavaDoc con) throws TorqueException
2077    {
2078          if (!alreadyInSave)
2079        {
2080            alreadyInSave = true;
2081
2082
2083  
2084            // If this object has been modified, then save it to the database.
2085
if (isModified())
2086            {
2087                if (isNew())
2088                {
2089                    LanguagePeer.doInsert((Language) this, con);
2090                    setNew(false);
2091                }
2092                else
2093                {
2094                    LanguagePeer.doUpdate((Language) this, con);
2095                }
2096            }
2097
2098                                      
2099                
2100                    if (collNotifications != null)
2101            {
2102                for (int i = 0; i < collNotifications.size(); i++)
2103                {
2104                    ((Notification) collNotifications.get(i)).save(con);
2105                }
2106            }
2107                                                  
2108                
2109                    if (collCustomers != null)
2110            {
2111                for (int i = 0; i < collCustomers.size(); i++)
2112                {
2113                    ((Customer) collCustomers.get(i)).save(con);
2114                }
2115            }
2116                                                            
2117                
2118                    if (collNewslettersRelatedByCustLanguageId != null)
2119            {
2120                for (int i = 0; i < collNewslettersRelatedByCustLanguageId.size(); i++)
2121                {
2122                    ((Newsletter) collNewslettersRelatedByCustLanguageId.get(i)).save(con);
2123                }
2124            }
2125                                                            
2126                
2127                    if (collNewslettersRelatedByLanguageId != null)
2128            {
2129                for (int i = 0; i < collNewslettersRelatedByLanguageId.size(); i++)
2130                {
2131                    ((Newsletter) collNewslettersRelatedByLanguageId.get(i)).save(con);
2132                }
2133            }
2134                                  alreadyInSave = false;
2135        }
2136      }
2137
2138                        
2139      /**
2140     * Set the PrimaryKey using ObjectKey.
2141     *
2142     * @param key languageId ObjectKey
2143     */

2144    public void setPrimaryKey(ObjectKey key)
2145        throws TorqueException
2146    {
2147            setLanguageId(((NumberKey) key).intValue());
2148        }
2149
2150    /**
2151     * Set the PrimaryKey using a String.
2152     *
2153     * @param key
2154     */

2155    public void setPrimaryKey(String JavaDoc key) throws TorqueException
2156    {
2157            setLanguageId(Integer.parseInt(key));
2158        }
2159
2160  
2161    /**
2162     * returns an id that differentiates this object from others
2163     * of its class.
2164     */

2165    public ObjectKey getPrimaryKey()
2166    {
2167          return SimpleKey.keyFor(getLanguageId());
2168      }
2169 
2170    /**
2171     * get an id that differentiates this object from others
2172     * of its class.
2173     */

2174    public String JavaDoc getQueryKey()
2175    {
2176        if (getPrimaryKey() == null)
2177        {
2178            return "";
2179        }
2180        else
2181        {
2182            return getPrimaryKey().toString();
2183        }
2184    }
2185
2186    /**
2187     * set an id that differentiates this object from others
2188     * of its class.
2189     */

2190    public void setQueryKey(String JavaDoc key)
2191        throws TorqueException
2192    {
2193        setPrimaryKey(key);
2194    }
2195
2196    /**
2197     * Makes a copy of this object.
2198     * It creates a new object filling in the simple attributes.
2199       * It then fills all the association collections and sets the
2200     * related objects to isNew=true.
2201       */

2202      public Language copy() throws TorqueException
2203    {
2204        return copyInto(new Language());
2205    }
2206  
2207    protected Language copyInto(Language copyObj) throws TorqueException
2208    {
2209          copyObj.setLanguageId(languageId);
2210          copyObj.setLanguageName(languageName);
2211          copyObj.setLanguageCode(languageCode);
2212  
2213                            copyObj.setLanguageId( 0);
2214                        
2215                                      
2216                            
2217        List JavaDoc v = getNotifications();
2218        for (int i = 0; i < v.size(); i++)
2219        {
2220            Notification obj = (Notification) v.get(i);
2221            copyObj.addNotification(obj.copy());
2222        }
2223                                                  
2224                            
2225        v = getCustomers();
2226        for (int i = 0; i < v.size(); i++)
2227        {
2228            Customer obj = (Customer) v.get(i);
2229            copyObj.addCustomer(obj.copy());
2230        }
2231                                                            
2232                            
2233        v = getNewslettersRelatedByCustLanguageId();
2234        for (int i = 0; i < v.size(); i++)
2235        {
2236            Newsletter obj = (Newsletter) v.get(i);
2237            copyObj.addNewsletterRelatedByCustLanguageId(obj.copy());
2238        }
2239                                                            
2240                            
2241        v = getNewslettersRelatedByLanguageId();
2242        for (int i = 0; i < v.size(); i++)
2243        {
2244            Newsletter obj = (Newsletter) v.get(i);
2245            copyObj.addNewsletterRelatedByLanguageId(obj.copy());
2246        }
2247                            return copyObj;
2248    }
2249
2250    /**
2251     * returns a peer instance associated with this om. Since Peer classes
2252     * are not to have any instance attributes, this method returns the
2253     * same instance for all member of this class. The method could therefore
2254     * be static, but this would prevent one from overriding the behavior.
2255     */

2256    public LanguagePeer getPeer()
2257    {
2258        return peer;
2259    }
2260
2261    public String JavaDoc toString()
2262    {
2263        StringBuffer JavaDoc str = new StringBuffer JavaDoc();
2264        str.append("Language:\n");
2265        str.append("LanguageId = ")
2266               .append(getLanguageId())
2267             .append("\n");
2268        str.append("LanguageName = ")
2269               .append(getLanguageName())
2270             .append("\n");
2271        str.append("LanguageCode = ")
2272               .append(getLanguageCode())
2273             .append("\n");
2274        return(str.toString());
2275    }
2276}
2277
Popular Tags