View Javadoc

1   package olr.om;
2   
3   
4   import java.sql.Connection;
5   import java.util.ArrayList;
6   import java.util.Collections;
7   import java.util.Date;
8   import java.util.List;
9   
10  import org.apache.commons.lang.ObjectUtils;
11  import org.apache.torque.TorqueException;
12  import org.apache.torque.om.BaseObject;
13  import org.apache.torque.om.NumberKey;
14  import org.apache.torque.om.ObjectKey;
15  import org.apache.torque.om.SimpleKey;
16  import org.apache.torque.util.Criteria;
17  import org.apache.torque.util.Transaction;
18  
19    
20    
21  /***
22   * This class was autogenerated by Torque on:
23   *
24   * [Tue Jul 13 14:47:47 CEST 2004]
25   *
26   * You should not use this class directly.  It should not even be
27   * extended all references should be to RdfUser
28   */
29  public abstract class BaseRdfUser extends BaseObject
30  {
31      /*** The Peer class */
32      private static final RdfUserPeer peer =
33          new RdfUserPeer();
34  
35          
36      /*** The value for the id field */
37      private int id;
38        
39      /*** The value for the firstName field */
40      private String firstName;
41        
42      /*** The value for the lastName field */
43      private String lastName;
44        
45      /*** The value for the description field */
46      private String description;
47        
48      /*** The value for the login field */
49      private String login;
50        
51      /*** The value for the password field */
52      private String password;
53        
54      /*** The value for the email field */
55      private String email;
56        
57      /*** The value for the lastAccess field */
58      private Date lastAccess;
59        
60      /*** The value for the sessionKey field */
61      private long sessionKey;
62        
63      /*** The value for the groupId field */
64      private int groupId;
65    
66      
67      /***
68       * Get the Id
69       *
70       * @return int
71       */
72      public int getId()
73      {
74          return id;
75      }
76  
77                                                
78      /***
79       * Set the value of Id
80       *
81       * @param v new value
82       */
83      public void setId(int v) throws TorqueException
84      {
85      
86                    if (this.id != v)
87                {
88              this.id = v;
89              setModified(true);
90          }
91      
92            
93                                    
94          // update associated RdfLiteral
95          if (collRdfLiterals != null)
96          {
97              for (int i = 0; i < collRdfLiterals.size(); i++)
98              {
99                  ((RdfLiteral) collRdfLiterals.get(i))
100                     .setUsr(v);
101             }
102         }
103                                           
104         // update associated RdfNamespace
105         if (collRdfNamespaces != null)
106         {
107             for (int i = 0; i < collRdfNamespaces.size(); i++)
108             {
109                 ((RdfNamespace) collRdfNamespaces.get(i))
110                     .setUsr(v);
111             }
112         }
113                                           
114         // update associated RdfResource
115         if (collRdfResources != null)
116         {
117             for (int i = 0; i < collRdfResources.size(); i++)
118             {
119                 ((RdfResource) collRdfResources.get(i))
120                     .setUsr(v);
121             }
122         }
123                                           
124         // update associated RdfStatement
125         if (collRdfStatements != null)
126         {
127             for (int i = 0; i < collRdfStatements.size(); i++)
128             {
129                 ((RdfStatement) collRdfStatements.get(i))
130                     .setUsr(v);
131             }
132         }
133                                           
134         // update associated Model
135         if (collModels != null)
136         {
137             for (int i = 0; i < collModels.size(); i++)
138             {
139                 ((Model) collModels.get(i))
140                     .setLockedBy(v);
141             }
142         }
143                                           
144         // update associated ModelStatement
145         if (collModelStatements != null)
146         {
147             for (int i = 0; i < collModelStatements.size(); i++)
148             {
149                 ((ModelStatement) collModelStatements.get(i))
150                     .setUsr(v);
151             }
152         }
153                                           
154         // update associated RdfToolbar
155         if (collRdfToolbars != null)
156         {
157             for (int i = 0; i < collRdfToolbars.size(); i++)
158             {
159                 ((RdfToolbar) collRdfToolbars.get(i))
160                     .setUsr(v);
161             }
162         }
163                       }
164   
165     /***
166      * Get the FirstName
167      *
168      * @return String
169      */
170     public String getFirstName()
171     {
172         return firstName;
173     }
174 
175                         
176     /***
177      * Set the value of FirstName
178      *
179      * @param v new value
180      */
181     public void setFirstName(String v) 
182     {
183     
184                   if (!ObjectUtils.equals(this.firstName, v))
185               {
186             this.firstName = v;
187             setModified(true);
188         }
189     
190           
191               }
192   
193     /***
194      * Get the LastName
195      *
196      * @return String
197      */
198     public String getLastName()
199     {
200         return lastName;
201     }
202 
203                         
204     /***
205      * Set the value of LastName
206      *
207      * @param v new value
208      */
209     public void setLastName(String v) 
210     {
211     
212                   if (!ObjectUtils.equals(this.lastName, v))
213               {
214             this.lastName = v;
215             setModified(true);
216         }
217     
218           
219               }
220   
221     /***
222      * Get the Description
223      *
224      * @return String
225      */
226     public String getDescription()
227     {
228         return description;
229     }
230 
231                         
232     /***
233      * Set the value of Description
234      *
235      * @param v new value
236      */
237     public void setDescription(String v) 
238     {
239     
240                   if (!ObjectUtils.equals(this.description, v))
241               {
242             this.description = v;
243             setModified(true);
244         }
245     
246           
247               }
248   
249     /***
250      * Get the Login
251      *
252      * @return String
253      */
254     public String getLogin()
255     {
256         return login;
257     }
258 
259                         
260     /***
261      * Set the value of Login
262      *
263      * @param v new value
264      */
265     public void setLogin(String v) 
266     {
267     
268                   if (!ObjectUtils.equals(this.login, v))
269               {
270             this.login = v;
271             setModified(true);
272         }
273     
274           
275               }
276   
277     /***
278      * Get the Password
279      *
280      * @return String
281      */
282     public String getPassword()
283     {
284         return password;
285     }
286 
287                         
288     /***
289      * Set the value of Password
290      *
291      * @param v new value
292      */
293     public void setPassword(String v) 
294     {
295     
296                   if (!ObjectUtils.equals(this.password, v))
297               {
298             this.password = v;
299             setModified(true);
300         }
301     
302           
303               }
304   
305     /***
306      * Get the Email
307      *
308      * @return String
309      */
310     public String getEmail()
311     {
312         return email;
313     }
314 
315                         
316     /***
317      * Set the value of Email
318      *
319      * @param v new value
320      */
321     public void setEmail(String v) 
322     {
323     
324                   if (!ObjectUtils.equals(this.email, v))
325               {
326             this.email = v;
327             setModified(true);
328         }
329     
330           
331               }
332   
333     /***
334      * Get the LastAccess
335      *
336      * @return Date
337      */
338     public Date getLastAccess()
339     {
340         return lastAccess;
341     }
342 
343                         
344     /***
345      * Set the value of LastAccess
346      *
347      * @param v new value
348      */
349     public void setLastAccess(Date v) 
350     {
351     
352                   if (!ObjectUtils.equals(this.lastAccess, v))
353               {
354             this.lastAccess = v;
355             setModified(true);
356         }
357     
358           
359               }
360   
361     /***
362      * Get the SessionKey
363      *
364      * @return long
365      */
366     public long getSessionKey()
367     {
368         return sessionKey;
369     }
370 
371                         
372     /***
373      * Set the value of SessionKey
374      *
375      * @param v new value
376      */
377     public void setSessionKey(long v) 
378     {
379     
380                   if (this.sessionKey != v)
381               {
382             this.sessionKey = v;
383             setModified(true);
384         }
385     
386           
387               }
388   
389     /***
390      * Get the GroupId
391      *
392      * @return int
393      */
394     public int getGroupId()
395     {
396         return groupId;
397     }
398 
399                               
400     /***
401      * Set the value of GroupId
402      *
403      * @param v new value
404      */
405     public void setGroupId(int v) throws TorqueException
406     {
407     
408                   if (this.groupId != v)
409               {
410             this.groupId = v;
411             setModified(true);
412         }
413     
414                           
415                 if (aRdfGroup != null && !(aRdfGroup.getId() == v))
416                 {
417             aRdfGroup = null;
418         }
419       
420               }
421   
422       
423     
424                   
425     
426         private RdfGroup aRdfGroup;
427 
428     /***
429      * Declares an association between this object and a RdfGroup object
430      *
431      * @param v RdfGroup
432      * @throws TorqueException
433      */
434     public void setRdfGroup(RdfGroup v) throws TorqueException
435     {
436             if (v == null)
437         {
438                     setGroupId(0);
439                   }
440         else
441         {
442             setGroupId(v.getId());
443         }
444                 aRdfGroup = v;
445     }
446 
447                                             
448     /***
449      * Get the associated RdfGroup object
450      *
451      * @return the associated RdfGroup object
452      * @throws TorqueException
453      */
454     public RdfGroup getRdfGroup() throws TorqueException
455     {
456         if (aRdfGroup == null && (this.groupId > 0))
457         {
458                           aRdfGroup = RdfGroupPeer.retrieveByPK(SimpleKey.keyFor(this.groupId));
459               
460             /* The following can be used instead of the line above to
461                guarantee the related object contains a reference
462                to this object, but this level of coupling
463                may be undesirable in many circumstances.
464                As it can lead to a db query with many results that may
465                never be used.
466                RdfGroup obj = RdfGroupPeer.retrieveByPK(this.groupId);
467                obj.addRdfUsers(this);
468             */
469         }
470         return aRdfGroup;
471     }
472 
473     /***
474      * Provides convenient way to set a relationship based on a
475      * ObjectKey.  e.g.
476      * <code>bar.setFooKey(foo.getPrimaryKey())</code>
477      *
478            */
479     public void setRdfGroupKey(ObjectKey key) throws TorqueException
480     {
481       
482                         setGroupId(((NumberKey) key).intValue());
483                   }
484        
485                                 
486             
487     /***
488      * Collection to store aggregation of collRdfLiterals
489      */
490     protected List collRdfLiterals;
491 
492     /***
493      * Temporary storage of collRdfLiterals to save a possible db hit in
494      * the event objects are add to the collection, but the
495      * complete collection is never requested.
496      */
497     protected void initRdfLiterals()
498     {
499         if (collRdfLiterals == null)
500         {
501             collRdfLiterals = new ArrayList();
502         }
503     }
504 
505     /***
506      * Method called to associate a RdfLiteral object to this object
507      * through the RdfLiteral foreign key attribute
508      *
509      * @param l RdfLiteral
510      * @throws TorqueException
511      */
512     public void addRdfLiteral(RdfLiteral l) throws TorqueException
513     {
514         getRdfLiterals().add(l);
515         l.setRdfUser((RdfUser) this);
516     }
517 
518     /***
519      * The criteria used to select the current contents of collRdfLiterals
520      */
521     private Criteria lastRdfLiteralsCriteria = null;
522 
523     /***
524      * If this collection has already been initialized, returns
525      * the collection. Otherwise returns the results of
526      * getRdfLiterals(new Criteria())
527      *
528      * @throws TorqueException
529      */
530     public List getRdfLiterals() throws TorqueException
531     {
532         if (collRdfLiterals == null)
533         {
534             collRdfLiterals = getRdfLiterals(new Criteria(10));
535         }
536         return collRdfLiterals;
537     }
538 
539     /***
540      * If this collection has already been initialized with
541      * an identical criteria, it returns the collection.
542      * Otherwise if this RdfUser has previously
543      * been saved, it will retrieve related RdfLiterals from storage.
544      * If this RdfUser is new, it will return
545      * an empty collection or the current collection, the criteria
546      * is ignored on a new object.
547      *
548      * @throws TorqueException
549      */
550     public List getRdfLiterals(Criteria criteria) throws TorqueException
551     {
552         if (collRdfLiterals == null)
553         {
554             if (isNew())
555             {
556                collRdfLiterals = new ArrayList();
557             }
558             else
559             {
560                       criteria.add(RdfLiteralPeer.USR, getId() );
561                       collRdfLiterals = RdfLiteralPeer.doSelect(criteria);
562             }
563         }
564         else
565         {
566             // criteria has no effect for a new object
567             if (!isNew())
568             {
569                 // the following code is to determine if a new query is
570                 // called for.  If the criteria is the same as the last
571                 // one, just return the collection.
572                       criteria.add(RdfLiteralPeer.USR, getId());
573                       if (!lastRdfLiteralsCriteria.equals(criteria))
574                 {
575                     collRdfLiterals = RdfLiteralPeer.doSelect(criteria);
576                 }
577             }
578         }
579         lastRdfLiteralsCriteria = criteria;
580 
581         return collRdfLiterals;
582     }
583 
584     /***
585      * If this collection has already been initialized, returns
586      * the collection. Otherwise returns the results of
587      * getRdfLiterals(new Criteria(),Connection)
588      * This method takes in the Connection also as input so that
589      * referenced objects can also be obtained using a Connection
590      * that is taken as input
591      */
592     public List getRdfLiterals(Connection con) throws TorqueException
593     {
594         if (collRdfLiterals == null)
595         {
596             collRdfLiterals = getRdfLiterals(new Criteria(10), con);
597         }
598         return collRdfLiterals;
599     }
600 
601     /***
602      * If this collection has already been initialized with
603      * an identical criteria, it returns the collection.
604      * Otherwise if this RdfUser has previously
605      * been saved, it will retrieve related RdfLiterals from storage.
606      * If this RdfUser is new, it will return
607      * an empty collection or the current collection, the criteria
608      * is ignored on a new object.
609      * This method takes in the Connection also as input so that
610      * referenced objects can also be obtained using a Connection
611      * that is taken as input
612      */
613     public List getRdfLiterals(Criteria criteria, Connection con)
614             throws TorqueException
615     {
616         if (collRdfLiterals == null)
617         {
618             if (isNew())
619             {
620                collRdfLiterals = new ArrayList();
621             }
622             else
623             {
624                        criteria.add(RdfLiteralPeer.USR, getId());
625                        collRdfLiterals = RdfLiteralPeer.doSelect(criteria, con);
626              }
627          }
628          else
629          {
630              // criteria has no effect for a new object
631              if (!isNew())
632              {
633                  // the following code is to determine if a new query is
634                  // called for.  If the criteria is the same as the last
635                  // one, just return the collection.
636                        criteria.add(RdfLiteralPeer.USR, getId());
637                        if (!lastRdfLiteralsCriteria.equals(criteria))
638                  {
639                      collRdfLiterals = RdfLiteralPeer.doSelect(criteria, con);
640                  }
641              }
642          }
643          lastRdfLiteralsCriteria = criteria;
644 
645          return collRdfLiterals;
646      }
647 
648                   
649               
650                     
651                               
652                                 
653                                                               
654                                         
655                     
656                     
657           
658     /***
659      * If this collection has already been initialized with
660      * an identical criteria, it returns the collection.
661      * Otherwise if this RdfUser is new, it will return
662      * an empty collection; or if this RdfUser has previously
663      * been saved, it will retrieve related RdfLiterals from storage.
664      *
665      * This method is protected by default in order to keep the public
666      * api reasonable.  You can provide public methods for those you
667      * actually need in RdfUser.
668      */
669     protected List getRdfLiteralsJoinRdfUser(Criteria criteria)
670         throws TorqueException
671     {
672         if (collRdfLiterals == null)
673         {
674             if (isNew())
675             {
676                collRdfLiterals = new ArrayList();
677             }
678             else
679             {
680                             criteria.add(RdfLiteralPeer.USR, getId());
681                             collRdfLiterals = RdfLiteralPeer.doSelectJoinRdfUser(criteria);
682             }
683         }
684         else
685         {
686             // the following code is to determine if a new query is
687             // called for.  If the criteria is the same as the last
688             // one, just return the collection.
689             boolean newCriteria = true;
690                         criteria.add(RdfLiteralPeer.USR, getId());
691                         if (!lastRdfLiteralsCriteria.equals(criteria))
692             {
693                 collRdfLiterals = RdfLiteralPeer.doSelectJoinRdfUser(criteria);
694             }
695         }
696         lastRdfLiteralsCriteria = criteria;
697 
698         return collRdfLiterals;
699     }
700                             
701 
702 
703                           
704             
705     /***
706      * Collection to store aggregation of collRdfNamespaces
707      */
708     protected List collRdfNamespaces;
709 
710     /***
711      * Temporary storage of collRdfNamespaces to save a possible db hit in
712      * the event objects are add to the collection, but the
713      * complete collection is never requested.
714      */
715     protected void initRdfNamespaces()
716     {
717         if (collRdfNamespaces == null)
718         {
719             collRdfNamespaces = new ArrayList();
720         }
721     }
722 
723     /***
724      * Method called to associate a RdfNamespace object to this object
725      * through the RdfNamespace foreign key attribute
726      *
727      * @param l RdfNamespace
728      * @throws TorqueException
729      */
730     public void addRdfNamespace(RdfNamespace l) throws TorqueException
731     {
732         getRdfNamespaces().add(l);
733         l.setRdfUser((RdfUser) this);
734     }
735 
736     /***
737      * The criteria used to select the current contents of collRdfNamespaces
738      */
739     private Criteria lastRdfNamespacesCriteria = null;
740 
741     /***
742      * If this collection has already been initialized, returns
743      * the collection. Otherwise returns the results of
744      * getRdfNamespaces(new Criteria())
745      *
746      * @throws TorqueException
747      */
748     public List getRdfNamespaces() throws TorqueException
749     {
750         if (collRdfNamespaces == null)
751         {
752             collRdfNamespaces = getRdfNamespaces(new Criteria(10));
753         }
754         return collRdfNamespaces;
755     }
756 
757     /***
758      * If this collection has already been initialized with
759      * an identical criteria, it returns the collection.
760      * Otherwise if this RdfUser has previously
761      * been saved, it will retrieve related RdfNamespaces from storage.
762      * If this RdfUser is new, it will return
763      * an empty collection or the current collection, the criteria
764      * is ignored on a new object.
765      *
766      * @throws TorqueException
767      */
768     public List getRdfNamespaces(Criteria criteria) throws TorqueException
769     {
770         if (collRdfNamespaces == null)
771         {
772             if (isNew())
773             {
774                collRdfNamespaces = new ArrayList();
775             }
776             else
777             {
778                       criteria.add(RdfNamespacePeer.USR, getId() );
779                       collRdfNamespaces = RdfNamespacePeer.doSelect(criteria);
780             }
781         }
782         else
783         {
784             // criteria has no effect for a new object
785             if (!isNew())
786             {
787                 // the following code is to determine if a new query is
788                 // called for.  If the criteria is the same as the last
789                 // one, just return the collection.
790                       criteria.add(RdfNamespacePeer.USR, getId());
791                       if (!lastRdfNamespacesCriteria.equals(criteria))
792                 {
793                     collRdfNamespaces = RdfNamespacePeer.doSelect(criteria);
794                 }
795             }
796         }
797         lastRdfNamespacesCriteria = criteria;
798 
799         return collRdfNamespaces;
800     }
801 
802     /***
803      * If this collection has already been initialized, returns
804      * the collection. Otherwise returns the results of
805      * getRdfNamespaces(new Criteria(),Connection)
806      * This method takes in the Connection also as input so that
807      * referenced objects can also be obtained using a Connection
808      * that is taken as input
809      */
810     public List getRdfNamespaces(Connection con) throws TorqueException
811     {
812         if (collRdfNamespaces == null)
813         {
814             collRdfNamespaces = getRdfNamespaces(new Criteria(10), con);
815         }
816         return collRdfNamespaces;
817     }
818 
819     /***
820      * If this collection has already been initialized with
821      * an identical criteria, it returns the collection.
822      * Otherwise if this RdfUser has previously
823      * been saved, it will retrieve related RdfNamespaces from storage.
824      * If this RdfUser is new, it will return
825      * an empty collection or the current collection, the criteria
826      * is ignored on a new object.
827      * This method takes in the Connection also as input so that
828      * referenced objects can also be obtained using a Connection
829      * that is taken as input
830      */
831     public List getRdfNamespaces(Criteria criteria, Connection con)
832             throws TorqueException
833     {
834         if (collRdfNamespaces == null)
835         {
836             if (isNew())
837             {
838                collRdfNamespaces = new ArrayList();
839             }
840             else
841             {
842                        criteria.add(RdfNamespacePeer.USR, getId());
843                        collRdfNamespaces = RdfNamespacePeer.doSelect(criteria, con);
844              }
845          }
846          else
847          {
848              // criteria has no effect for a new object
849              if (!isNew())
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                        criteria.add(RdfNamespacePeer.USR, getId());
855                        if (!lastRdfNamespacesCriteria.equals(criteria))
856                  {
857                      collRdfNamespaces = RdfNamespacePeer.doSelect(criteria, con);
858                  }
859              }
860          }
861          lastRdfNamespacesCriteria = criteria;
862 
863          return collRdfNamespaces;
864      }
865 
866                   
867               
868                     
869                               
870                                 
871                                                               
872                                         
873                     
874                     
875           
876     /***
877      * If this collection has already been initialized with
878      * an identical criteria, it returns the collection.
879      * Otherwise if this RdfUser is new, it will return
880      * an empty collection; or if this RdfUser has previously
881      * been saved, it will retrieve related RdfNamespaces from storage.
882      *
883      * This method is protected by default in order to keep the public
884      * api reasonable.  You can provide public methods for those you
885      * actually need in RdfUser.
886      */
887     protected List getRdfNamespacesJoinRdfUser(Criteria criteria)
888         throws TorqueException
889     {
890         if (collRdfNamespaces == null)
891         {
892             if (isNew())
893             {
894                collRdfNamespaces = new ArrayList();
895             }
896             else
897             {
898                             criteria.add(RdfNamespacePeer.USR, getId());
899                             collRdfNamespaces = RdfNamespacePeer.doSelectJoinRdfUser(criteria);
900             }
901         }
902         else
903         {
904             // the following code is to determine if a new query is
905             // called for.  If the criteria is the same as the last
906             // one, just return the collection.
907             boolean newCriteria = true;
908                         criteria.add(RdfNamespacePeer.USR, getId());
909                         if (!lastRdfNamespacesCriteria.equals(criteria))
910             {
911                 collRdfNamespaces = RdfNamespacePeer.doSelectJoinRdfUser(criteria);
912             }
913         }
914         lastRdfNamespacesCriteria = criteria;
915 
916         return collRdfNamespaces;
917     }
918                             
919 
920 
921                           
922             
923     /***
924      * Collection to store aggregation of collRdfResources
925      */
926     protected List collRdfResources;
927 
928     /***
929      * Temporary storage of collRdfResources to save a possible db hit in
930      * the event objects are add to the collection, but the
931      * complete collection is never requested.
932      */
933     protected void initRdfResources()
934     {
935         if (collRdfResources == null)
936         {
937             collRdfResources = new ArrayList();
938         }
939     }
940 
941     /***
942      * Method called to associate a RdfResource object to this object
943      * through the RdfResource foreign key attribute
944      *
945      * @param l RdfResource
946      * @throws TorqueException
947      */
948     public void addRdfResource(RdfResource l) throws TorqueException
949     {
950         getRdfResources().add(l);
951         l.setRdfUser((RdfUser) this);
952     }
953 
954     /***
955      * The criteria used to select the current contents of collRdfResources
956      */
957     private Criteria lastRdfResourcesCriteria = null;
958 
959     /***
960      * If this collection has already been initialized, returns
961      * the collection. Otherwise returns the results of
962      * getRdfResources(new Criteria())
963      *
964      * @throws TorqueException
965      */
966     public List getRdfResources() throws TorqueException
967     {
968         if (collRdfResources == null)
969         {
970             collRdfResources = getRdfResources(new Criteria(10));
971         }
972         return collRdfResources;
973     }
974 
975     /***
976      * If this collection has already been initialized with
977      * an identical criteria, it returns the collection.
978      * Otherwise if this RdfUser has previously
979      * been saved, it will retrieve related RdfResources from storage.
980      * If this RdfUser is new, it will return
981      * an empty collection or the current collection, the criteria
982      * is ignored on a new object.
983      *
984      * @throws TorqueException
985      */
986     public List getRdfResources(Criteria criteria) throws TorqueException
987     {
988         if (collRdfResources == null)
989         {
990             if (isNew())
991             {
992                collRdfResources = new ArrayList();
993             }
994             else
995             {
996                       criteria.add(RdfResourcePeer.USR, getId() );
997                       collRdfResources = RdfResourcePeer.doSelect(criteria);
998             }
999         }
1000         else
1001         {
1002             // criteria has no effect for a new object
1003             if (!isNew())
1004             {
1005                 // the following code is to determine if a new query is
1006                 // called for.  If the criteria is the same as the last
1007                 // one, just return the collection.
1008                       criteria.add(RdfResourcePeer.USR, getId());
1009                       if (!lastRdfResourcesCriteria.equals(criteria))
1010                 {
1011                     collRdfResources = RdfResourcePeer.doSelect(criteria);
1012                 }
1013             }
1014         }
1015         lastRdfResourcesCriteria = criteria;
1016 
1017         return collRdfResources;
1018     }
1019 
1020     /***
1021      * If this collection has already been initialized, returns
1022      * the collection. Otherwise returns the results of
1023      * getRdfResources(new Criteria(),Connection)
1024      * This method takes in the Connection also as input so that
1025      * referenced objects can also be obtained using a Connection
1026      * that is taken as input
1027      */
1028     public List getRdfResources(Connection con) throws TorqueException
1029     {
1030         if (collRdfResources == null)
1031         {
1032             collRdfResources = getRdfResources(new Criteria(10), con);
1033         }
1034         return collRdfResources;
1035     }
1036 
1037     /***
1038      * If this collection has already been initialized with
1039      * an identical criteria, it returns the collection.
1040      * Otherwise if this RdfUser has previously
1041      * been saved, it will retrieve related RdfResources from storage.
1042      * If this RdfUser is new, it will return
1043      * an empty collection or the current collection, the criteria
1044      * is ignored on a new object.
1045      * This method takes in the Connection also as input so that
1046      * referenced objects can also be obtained using a Connection
1047      * that is taken as input
1048      */
1049     public List getRdfResources(Criteria criteria, Connection con)
1050             throws TorqueException
1051     {
1052         if (collRdfResources == null)
1053         {
1054             if (isNew())
1055             {
1056                collRdfResources = new ArrayList();
1057             }
1058             else
1059             {
1060                        criteria.add(RdfResourcePeer.USR, getId());
1061                        collRdfResources = RdfResourcePeer.doSelect(criteria, con);
1062              }
1063          }
1064          else
1065          {
1066              // criteria has no effect for a new object
1067              if (!isNew())
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                        criteria.add(RdfResourcePeer.USR, getId());
1073                        if (!lastRdfResourcesCriteria.equals(criteria))
1074                  {
1075                      collRdfResources = RdfResourcePeer.doSelect(criteria, con);
1076                  }
1077              }
1078          }
1079          lastRdfResourcesCriteria = criteria;
1080 
1081          return collRdfResources;
1082      }
1083 
1084                         
1085               
1086                     
1087                     
1088                                 
1089                                                               
1090                                         
1091                     
1092                     
1093           
1094     /***
1095      * If this collection has already been initialized with
1096      * an identical criteria, it returns the collection.
1097      * Otherwise if this RdfUser is new, it will return
1098      * an empty collection; or if this RdfUser has previously
1099      * been saved, it will retrieve related RdfResources from storage.
1100      *
1101      * This method is protected by default in order to keep the public
1102      * api reasonable.  You can provide public methods for those you
1103      * actually need in RdfUser.
1104      */
1105     protected List getRdfResourcesJoinRdfNamespace(Criteria criteria)
1106         throws TorqueException
1107     {
1108         if (collRdfResources == null)
1109         {
1110             if (isNew())
1111             {
1112                collRdfResources = new ArrayList();
1113             }
1114             else
1115             {
1116                             criteria.add(RdfResourcePeer.USR, getId());
1117                             collRdfResources = RdfResourcePeer.doSelectJoinRdfNamespace(criteria);
1118             }
1119         }
1120         else
1121         {
1122             // the following code is to determine if a new query is
1123             // called for.  If the criteria is the same as the last
1124             // one, just return the collection.
1125             boolean newCriteria = true;
1126                         criteria.add(RdfResourcePeer.USR, getId());
1127                         if (!lastRdfResourcesCriteria.equals(criteria))
1128             {
1129                 collRdfResources = RdfResourcePeer.doSelectJoinRdfNamespace(criteria);
1130             }
1131         }
1132         lastRdfResourcesCriteria = criteria;
1133 
1134         return collRdfResources;
1135     }
1136                   
1137                     
1138                               
1139                                 
1140                                                               
1141                                         
1142                     
1143                     
1144           
1145     /***
1146      * If this collection has already been initialized with
1147      * an identical criteria, it returns the collection.
1148      * Otherwise if this RdfUser is new, it will return
1149      * an empty collection; or if this RdfUser has previously
1150      * been saved, it will retrieve related RdfResources from storage.
1151      *
1152      * This method is protected by default in order to keep the public
1153      * api reasonable.  You can provide public methods for those you
1154      * actually need in RdfUser.
1155      */
1156     protected List getRdfResourcesJoinRdfUser(Criteria criteria)
1157         throws TorqueException
1158     {
1159         if (collRdfResources == null)
1160         {
1161             if (isNew())
1162             {
1163                collRdfResources = new ArrayList();
1164             }
1165             else
1166             {
1167                             criteria.add(RdfResourcePeer.USR, getId());
1168                             collRdfResources = RdfResourcePeer.doSelectJoinRdfUser(criteria);
1169             }
1170         }
1171         else
1172         {
1173             // the following code is to determine if a new query is
1174             // called for.  If the criteria is the same as the last
1175             // one, just return the collection.
1176             boolean newCriteria = true;
1177                         criteria.add(RdfResourcePeer.USR, getId());
1178                         if (!lastRdfResourcesCriteria.equals(criteria))
1179             {
1180                 collRdfResources = RdfResourcePeer.doSelectJoinRdfUser(criteria);
1181             }
1182         }
1183         lastRdfResourcesCriteria = criteria;
1184 
1185         return collRdfResources;
1186     }
1187                             
1188 
1189 
1190                           
1191             
1192     /***
1193      * Collection to store aggregation of collRdfStatements
1194      */
1195     protected List collRdfStatements;
1196 
1197     /***
1198      * Temporary storage of collRdfStatements to save a possible db hit in
1199      * the event objects are add to the collection, but the
1200      * complete collection is never requested.
1201      */
1202     protected void initRdfStatements()
1203     {
1204         if (collRdfStatements == null)
1205         {
1206             collRdfStatements = new ArrayList();
1207         }
1208     }
1209 
1210     /***
1211      * Method called to associate a RdfStatement object to this object
1212      * through the RdfStatement foreign key attribute
1213      *
1214      * @param l RdfStatement
1215      * @throws TorqueException
1216      */
1217     public void addRdfStatement(RdfStatement l) throws TorqueException
1218     {
1219         getRdfStatements().add(l);
1220         l.setRdfUser((RdfUser) this);
1221     }
1222 
1223     /***
1224      * The criteria used to select the current contents of collRdfStatements
1225      */
1226     private Criteria lastRdfStatementsCriteria = null;
1227 
1228     /***
1229      * If this collection has already been initialized, returns
1230      * the collection. Otherwise returns the results of
1231      * getRdfStatements(new Criteria())
1232      *
1233      * @throws TorqueException
1234      */
1235     public List getRdfStatements() throws TorqueException
1236     {
1237         if (collRdfStatements == null)
1238         {
1239             collRdfStatements = getRdfStatements(new Criteria(10));
1240         }
1241         return collRdfStatements;
1242     }
1243 
1244     /***
1245      * If this collection has already been initialized with
1246      * an identical criteria, it returns the collection.
1247      * Otherwise if this RdfUser has previously
1248      * been saved, it will retrieve related RdfStatements from storage.
1249      * If this RdfUser is new, it will return
1250      * an empty collection or the current collection, the criteria
1251      * is ignored on a new object.
1252      *
1253      * @throws TorqueException
1254      */
1255     public List getRdfStatements(Criteria criteria) throws TorqueException
1256     {
1257         if (collRdfStatements == null)
1258         {
1259             if (isNew())
1260             {
1261                collRdfStatements = new ArrayList();
1262             }
1263             else
1264             {
1265                       criteria.add(RdfStatementPeer.USR, getId() );
1266                       collRdfStatements = RdfStatementPeer.doSelect(criteria);
1267             }
1268         }
1269         else
1270         {
1271             // criteria has no effect for a new object
1272             if (!isNew())
1273             {
1274                 // the following code is to determine if a new query is
1275                 // called for.  If the criteria is the same as the last
1276                 // one, just return the collection.
1277                       criteria.add(RdfStatementPeer.USR, getId());
1278                       if (!lastRdfStatementsCriteria.equals(criteria))
1279                 {
1280                     collRdfStatements = RdfStatementPeer.doSelect(criteria);
1281                 }
1282             }
1283         }
1284         lastRdfStatementsCriteria = criteria;
1285 
1286         return collRdfStatements;
1287     }
1288 
1289     /***
1290      * If this collection has already been initialized, returns
1291      * the collection. Otherwise returns the results of
1292      * getRdfStatements(new Criteria(),Connection)
1293      * This method takes in the Connection also as input so that
1294      * referenced objects can also be obtained using a Connection
1295      * that is taken as input
1296      */
1297     public List getRdfStatements(Connection con) throws TorqueException
1298     {
1299         if (collRdfStatements == null)
1300         {
1301             collRdfStatements = getRdfStatements(new Criteria(10), con);
1302         }
1303         return collRdfStatements;
1304     }
1305 
1306     /***
1307      * If this collection has already been initialized with
1308      * an identical criteria, it returns the collection.
1309      * Otherwise if this RdfUser has previously
1310      * been saved, it will retrieve related RdfStatements from storage.
1311      * If this RdfUser is new, it will return
1312      * an empty collection or the current collection, the criteria
1313      * is ignored on a new object.
1314      * This method takes in the Connection also as input so that
1315      * referenced objects can also be obtained using a Connection
1316      * that is taken as input
1317      */
1318     public List getRdfStatements(Criteria criteria, Connection con)
1319             throws TorqueException
1320     {
1321         if (collRdfStatements == null)
1322         {
1323             if (isNew())
1324             {
1325                collRdfStatements = new ArrayList();
1326             }
1327             else
1328             {
1329                        criteria.add(RdfStatementPeer.USR, getId());
1330                        collRdfStatements = RdfStatementPeer.doSelect(criteria, con);
1331              }
1332          }
1333          else
1334          {
1335              // criteria has no effect for a new object
1336              if (!isNew())
1337              {
1338                  // the following code is to determine if a new query is
1339                  // called for.  If the criteria is the same as the last
1340                  // one, just return the collection.
1341                        criteria.add(RdfStatementPeer.USR, getId());
1342                        if (!lastRdfStatementsCriteria.equals(criteria))
1343                  {
1344                      collRdfStatements = RdfStatementPeer.doSelect(criteria, con);
1345                  }
1346              }
1347          }
1348          lastRdfStatementsCriteria = criteria;
1349 
1350          return collRdfStatements;
1351      }
1352 
1353                                           
1354               
1355                     
1356                               
1357                                 
1358                                                               
1359                                         
1360                     
1361                     
1362           
1363     /***
1364      * If this collection has already been initialized with
1365      * an identical criteria, it returns the collection.
1366      * Otherwise if this RdfUser is new, it will return
1367      * an empty collection; or if this RdfUser has previously
1368      * been saved, it will retrieve related RdfStatements from storage.
1369      *
1370      * This method is protected by default in order to keep the public
1371      * api reasonable.  You can provide public methods for those you
1372      * actually need in RdfUser.
1373      */
1374     protected List getRdfStatementsJoinRdfUser(Criteria criteria)
1375         throws TorqueException
1376     {
1377         if (collRdfStatements == null)
1378         {
1379             if (isNew())
1380             {
1381                collRdfStatements = new ArrayList();
1382             }
1383             else
1384             {
1385                             criteria.add(RdfStatementPeer.USR, getId());
1386                             collRdfStatements = RdfStatementPeer.doSelectJoinRdfUser(criteria);
1387             }
1388         }
1389         else
1390         {
1391             // the following code is to determine if a new query is
1392             // called for.  If the criteria is the same as the last
1393             // one, just return the collection.
1394             boolean newCriteria = true;
1395                         criteria.add(RdfStatementPeer.USR, getId());
1396                         if (!lastRdfStatementsCriteria.equals(criteria))
1397             {
1398                 collRdfStatements = RdfStatementPeer.doSelectJoinRdfUser(criteria);
1399             }
1400         }
1401         lastRdfStatementsCriteria = criteria;
1402 
1403         return collRdfStatements;
1404     }
1405                   
1406                     
1407                     
1408                                             
1409                                                                           
1410                                         
1411                     
1412                     
1413           
1414     /***
1415      * If this collection has already been initialized with
1416      * an identical criteria, it returns the collection.
1417      * Otherwise if this RdfUser is new, it will return
1418      * an empty collection; or if this RdfUser has previously
1419      * been saved, it will retrieve related RdfStatements from storage.
1420      *
1421      * This method is protected by default in order to keep the public
1422      * api reasonable.  You can provide public methods for those you
1423      * actually need in RdfUser.
1424      */
1425     protected List getRdfStatementsJoinRdfResourceRelatedByPredicate(Criteria criteria)
1426         throws TorqueException
1427     {
1428         if (collRdfStatements == null)
1429         {
1430             if (isNew())
1431             {
1432                collRdfStatements = new ArrayList();
1433             }
1434             else
1435             {
1436                             criteria.add(RdfStatementPeer.USR, getId());
1437                             collRdfStatements = RdfStatementPeer.doSelectJoinRdfResourceRelatedByPredicate(criteria);
1438             }
1439         }
1440         else
1441         {
1442             // the following code is to determine if a new query is
1443             // called for.  If the criteria is the same as the last
1444             // one, just return the collection.
1445             boolean newCriteria = true;
1446                         criteria.add(RdfStatementPeer.USR, getId());
1447                         if (!lastRdfStatementsCriteria.equals(criteria))
1448             {
1449                 collRdfStatements = RdfStatementPeer.doSelectJoinRdfResourceRelatedByPredicate(criteria);
1450             }
1451         }
1452         lastRdfStatementsCriteria = criteria;
1453 
1454         return collRdfStatements;
1455     }
1456                   
1457                     
1458                     
1459                                             
1460                                                                           
1461                                         
1462                     
1463                     
1464           
1465     /***
1466      * If this collection has already been initialized with
1467      * an identical criteria, it returns the collection.
1468      * Otherwise if this RdfUser is new, it will return
1469      * an empty collection; or if this RdfUser has previously
1470      * been saved, it will retrieve related RdfStatements from storage.
1471      *
1472      * This method is protected by default in order to keep the public
1473      * api reasonable.  You can provide public methods for those you
1474      * actually need in RdfUser.
1475      */
1476     protected List getRdfStatementsJoinRdfResourceRelatedByObjResource(Criteria criteria)
1477         throws TorqueException
1478     {
1479         if (collRdfStatements == null)
1480         {
1481             if (isNew())
1482             {
1483                collRdfStatements = new ArrayList();
1484             }
1485             else
1486             {
1487                             criteria.add(RdfStatementPeer.USR, getId());
1488                             collRdfStatements = RdfStatementPeer.doSelectJoinRdfResourceRelatedByObjResource(criteria);
1489             }
1490         }
1491         else
1492         {
1493             // the following code is to determine if a new query is
1494             // called for.  If the criteria is the same as the last
1495             // one, just return the collection.
1496             boolean newCriteria = true;
1497                         criteria.add(RdfStatementPeer.USR, getId());
1498                         if (!lastRdfStatementsCriteria.equals(criteria))
1499             {
1500                 collRdfStatements = RdfStatementPeer.doSelectJoinRdfResourceRelatedByObjResource(criteria);
1501             }
1502         }
1503         lastRdfStatementsCriteria = criteria;
1504 
1505         return collRdfStatements;
1506     }
1507                   
1508                     
1509                     
1510                                             
1511                                                                           
1512                                         
1513                     
1514                     
1515           
1516     /***
1517      * If this collection has already been initialized with
1518      * an identical criteria, it returns the collection.
1519      * Otherwise if this RdfUser is new, it will return
1520      * an empty collection; or if this RdfUser has previously
1521      * been saved, it will retrieve related RdfStatements from storage.
1522      *
1523      * This method is protected by default in order to keep the public
1524      * api reasonable.  You can provide public methods for those you
1525      * actually need in RdfUser.
1526      */
1527     protected List getRdfStatementsJoinRdfResourceRelatedBySubject(Criteria criteria)
1528         throws TorqueException
1529     {
1530         if (collRdfStatements == null)
1531         {
1532             if (isNew())
1533             {
1534                collRdfStatements = new ArrayList();
1535             }
1536             else
1537             {
1538                             criteria.add(RdfStatementPeer.USR, getId());
1539                             collRdfStatements = RdfStatementPeer.doSelectJoinRdfResourceRelatedBySubject(criteria);
1540             }
1541         }
1542         else
1543         {
1544             // the following code is to determine if a new query is
1545             // called for.  If the criteria is the same as the last
1546             // one, just return the collection.
1547             boolean newCriteria = true;
1548                         criteria.add(RdfStatementPeer.USR, getId());
1549                         if (!lastRdfStatementsCriteria.equals(criteria))
1550             {
1551                 collRdfStatements = RdfStatementPeer.doSelectJoinRdfResourceRelatedBySubject(criteria);
1552             }
1553         }
1554         lastRdfStatementsCriteria = criteria;
1555 
1556         return collRdfStatements;
1557     }
1558                   
1559                     
1560                     
1561                                 
1562                                                               
1563                                         
1564                     
1565                     
1566           
1567     /***
1568      * If this collection has already been initialized with
1569      * an identical criteria, it returns the collection.
1570      * Otherwise if this RdfUser is new, it will return
1571      * an empty collection; or if this RdfUser has previously
1572      * been saved, it will retrieve related RdfStatements from storage.
1573      *
1574      * This method is protected by default in order to keep the public
1575      * api reasonable.  You can provide public methods for those you
1576      * actually need in RdfUser.
1577      */
1578     protected List getRdfStatementsJoinRdfLiteral(Criteria criteria)
1579         throws TorqueException
1580     {
1581         if (collRdfStatements == null)
1582         {
1583             if (isNew())
1584             {
1585                collRdfStatements = new ArrayList();
1586             }
1587             else
1588             {
1589                             criteria.add(RdfStatementPeer.USR, getId());
1590                             collRdfStatements = RdfStatementPeer.doSelectJoinRdfLiteral(criteria);
1591             }
1592         }
1593         else
1594         {
1595             // the following code is to determine if a new query is
1596             // called for.  If the criteria is the same as the last
1597             // one, just return the collection.
1598             boolean newCriteria = true;
1599                         criteria.add(RdfStatementPeer.USR, getId());
1600                         if (!lastRdfStatementsCriteria.equals(criteria))
1601             {
1602                 collRdfStatements = RdfStatementPeer.doSelectJoinRdfLiteral(criteria);
1603             }
1604         }
1605         lastRdfStatementsCriteria = criteria;
1606 
1607         return collRdfStatements;
1608     }
1609                             
1610 
1611 
1612                           
1613             
1614     /***
1615      * Collection to store aggregation of collModels
1616      */
1617     protected List collModels;
1618 
1619     /***
1620      * Temporary storage of collModels to save a possible db hit in
1621      * the event objects are add to the collection, but the
1622      * complete collection is never requested.
1623      */
1624     protected void initModels()
1625     {
1626         if (collModels == null)
1627         {
1628             collModels = new ArrayList();
1629         }
1630     }
1631 
1632     /***
1633      * Method called to associate a Model object to this object
1634      * through the Model foreign key attribute
1635      *
1636      * @param l Model
1637      * @throws TorqueException
1638      */
1639     public void addModel(Model l) throws TorqueException
1640     {
1641         getModels().add(l);
1642         l.setRdfUser((RdfUser) this);
1643     }
1644 
1645     /***
1646      * The criteria used to select the current contents of collModels
1647      */
1648     private Criteria lastModelsCriteria = null;
1649 
1650     /***
1651      * If this collection has already been initialized, returns
1652      * the collection. Otherwise returns the results of
1653      * getModels(new Criteria())
1654      *
1655      * @throws TorqueException
1656      */
1657     public List getModels() throws TorqueException
1658     {
1659         if (collModels == null)
1660         {
1661             collModels = getModels(new Criteria(10));
1662         }
1663         return collModels;
1664     }
1665 
1666     /***
1667      * If this collection has already been initialized with
1668      * an identical criteria, it returns the collection.
1669      * Otherwise if this RdfUser has previously
1670      * been saved, it will retrieve related Models from storage.
1671      * If this RdfUser is new, it will return
1672      * an empty collection or the current collection, the criteria
1673      * is ignored on a new object.
1674      *
1675      * @throws TorqueException
1676      */
1677     public List getModels(Criteria criteria) throws TorqueException
1678     {
1679         if (collModels == null)
1680         {
1681             if (isNew())
1682             {
1683                collModels = new ArrayList();
1684             }
1685             else
1686             {
1687                       criteria.add(ModelPeer.LOCKED_BY, getId() );
1688                       collModels = ModelPeer.doSelect(criteria);
1689             }
1690         }
1691         else
1692         {
1693             // criteria has no effect for a new object
1694             if (!isNew())
1695             {
1696                 // the following code is to determine if a new query is
1697                 // called for.  If the criteria is the same as the last
1698                 // one, just return the collection.
1699                       criteria.add(ModelPeer.LOCKED_BY, getId());
1700                       if (!lastModelsCriteria.equals(criteria))
1701                 {
1702                     collModels = ModelPeer.doSelect(criteria);
1703                 }
1704             }
1705         }
1706         lastModelsCriteria = criteria;
1707 
1708         return collModels;
1709     }
1710 
1711     /***
1712      * If this collection has already been initialized, returns
1713      * the collection. Otherwise returns the results of
1714      * getModels(new Criteria(),Connection)
1715      * This method takes in the Connection also as input so that
1716      * referenced objects can also be obtained using a Connection
1717      * that is taken as input
1718      */
1719     public List getModels(Connection con) throws TorqueException
1720     {
1721         if (collModels == null)
1722         {
1723             collModels = getModels(new Criteria(10), con);
1724         }
1725         return collModels;
1726     }
1727 
1728     /***
1729      * If this collection has already been initialized with
1730      * an identical criteria, it returns the collection.
1731      * Otherwise if this RdfUser has previously
1732      * been saved, it will retrieve related Models from storage.
1733      * If this RdfUser is new, it will return
1734      * an empty collection or the current collection, the criteria
1735      * is ignored on a new object.
1736      * This method takes in the Connection also as input so that
1737      * referenced objects can also be obtained using a Connection
1738      * that is taken as input
1739      */
1740     public List getModels(Criteria criteria, Connection con)
1741             throws TorqueException
1742     {
1743         if (collModels == null)
1744         {
1745             if (isNew())
1746             {
1747                collModels = new ArrayList();
1748             }
1749             else
1750             {
1751                        criteria.add(ModelPeer.LOCKED_BY, getId());
1752                        collModels = ModelPeer.doSelect(criteria, con);
1753              }
1754          }
1755          else
1756          {
1757              // criteria has no effect for a new object
1758              if (!isNew())
1759              {
1760                  // the following code is to determine if a new query is
1761                  // called for.  If the criteria is the same as the last
1762                  // one, just return the collection.
1763                        criteria.add(ModelPeer.LOCKED_BY, getId());
1764                        if (!lastModelsCriteria.equals(criteria))
1765                  {
1766                      collModels = ModelPeer.doSelect(criteria, con);
1767                  }
1768              }
1769          }
1770          lastModelsCriteria = criteria;
1771 
1772          return collModels;
1773      }
1774 
1775                   
1776               
1777                     
1778                               
1779                                 
1780                                                               
1781                                         
1782                     
1783                     
1784           
1785     /***
1786      * If this collection has already been initialized with
1787      * an identical criteria, it returns the collection.
1788      * Otherwise if this RdfUser is new, it will return
1789      * an empty collection; or if this RdfUser has previously
1790      * been saved, it will retrieve related Models from storage.
1791      *
1792      * This method is protected by default in order to keep the public
1793      * api reasonable.  You can provide public methods for those you
1794      * actually need in RdfUser.
1795      */
1796     protected List getModelsJoinRdfUser(Criteria criteria)
1797         throws TorqueException
1798     {
1799         if (collModels == null)
1800         {
1801             if (isNew())
1802             {
1803                collModels = new ArrayList();
1804             }
1805             else
1806             {
1807                             criteria.add(ModelPeer.LOCKED_BY, getId());
1808                             collModels = ModelPeer.doSelectJoinRdfUser(criteria);
1809             }
1810         }
1811         else
1812         {
1813             // the following code is to determine if a new query is
1814             // called for.  If the criteria is the same as the last
1815             // one, just return the collection.
1816             boolean newCriteria = true;
1817                         criteria.add(ModelPeer.LOCKED_BY, getId());
1818                         if (!lastModelsCriteria.equals(criteria))
1819             {
1820                 collModels = ModelPeer.doSelectJoinRdfUser(criteria);
1821             }
1822         }
1823         lastModelsCriteria = criteria;
1824 
1825         return collModels;
1826     }
1827                             
1828 
1829 
1830                           
1831             
1832     /***
1833      * Collection to store aggregation of collModelStatements
1834      */
1835     protected List collModelStatements;
1836 
1837     /***
1838      * Temporary storage of collModelStatements to save a possible db hit in
1839      * the event objects are add to the collection, but the
1840      * complete collection is never requested.
1841      */
1842     protected void initModelStatements()
1843     {
1844         if (collModelStatements == null)
1845         {
1846             collModelStatements = new ArrayList();
1847         }
1848     }
1849 
1850     /***
1851      * Method called to associate a ModelStatement object to this object
1852      * through the ModelStatement foreign key attribute
1853      *
1854      * @param l ModelStatement
1855      * @throws TorqueException
1856      */
1857     public void addModelStatement(ModelStatement l) throws TorqueException
1858     {
1859         getModelStatements().add(l);
1860         l.setRdfUser((RdfUser) this);
1861     }
1862 
1863     /***
1864      * The criteria used to select the current contents of collModelStatements
1865      */
1866     private Criteria lastModelStatementsCriteria = null;
1867 
1868     /***
1869      * If this collection has already been initialized, returns
1870      * the collection. Otherwise returns the results of
1871      * getModelStatements(new Criteria())
1872      *
1873      * @throws TorqueException
1874      */
1875     public List getModelStatements() throws TorqueException
1876     {
1877         if (collModelStatements == null)
1878         {
1879             collModelStatements = getModelStatements(new Criteria(10));
1880         }
1881         return collModelStatements;
1882     }
1883 
1884     /***
1885      * If this collection has already been initialized with
1886      * an identical criteria, it returns the collection.
1887      * Otherwise if this RdfUser has previously
1888      * been saved, it will retrieve related ModelStatements from storage.
1889      * If this RdfUser is new, it will return
1890      * an empty collection or the current collection, the criteria
1891      * is ignored on a new object.
1892      *
1893      * @throws TorqueException
1894      */
1895     public List getModelStatements(Criteria criteria) throws TorqueException
1896     {
1897         if (collModelStatements == null)
1898         {
1899             if (isNew())
1900             {
1901                collModelStatements = new ArrayList();
1902             }
1903             else
1904             {
1905                       criteria.add(ModelStatementPeer.USR, getId() );
1906                       collModelStatements = ModelStatementPeer.doSelect(criteria);
1907             }
1908         }
1909         else
1910         {
1911             // criteria has no effect for a new object
1912             if (!isNew())
1913             {
1914                 // the following code is to determine if a new query is
1915                 // called for.  If the criteria is the same as the last
1916                 // one, just return the collection.
1917                       criteria.add(ModelStatementPeer.USR, getId());
1918                       if (!lastModelStatementsCriteria.equals(criteria))
1919                 {
1920                     collModelStatements = ModelStatementPeer.doSelect(criteria);
1921                 }
1922             }
1923         }
1924         lastModelStatementsCriteria = criteria;
1925 
1926         return collModelStatements;
1927     }
1928 
1929     /***
1930      * If this collection has already been initialized, returns
1931      * the collection. Otherwise returns the results of
1932      * getModelStatements(new Criteria(),Connection)
1933      * This method takes in the Connection also as input so that
1934      * referenced objects can also be obtained using a Connection
1935      * that is taken as input
1936      */
1937     public List getModelStatements(Connection con) throws TorqueException
1938     {
1939         if (collModelStatements == null)
1940         {
1941             collModelStatements = getModelStatements(new Criteria(10), con);
1942         }
1943         return collModelStatements;
1944     }
1945 
1946     /***
1947      * If this collection has already been initialized with
1948      * an identical criteria, it returns the collection.
1949      * Otherwise if this RdfUser has previously
1950      * been saved, it will retrieve related ModelStatements from storage.
1951      * If this RdfUser is new, it will return
1952      * an empty collection or the current collection, the criteria
1953      * is ignored on a new object.
1954      * This method takes in the Connection also as input so that
1955      * referenced objects can also be obtained using a Connection
1956      * that is taken as input
1957      */
1958     public List getModelStatements(Criteria criteria, Connection con)
1959             throws TorqueException
1960     {
1961         if (collModelStatements == null)
1962         {
1963             if (isNew())
1964             {
1965                collModelStatements = new ArrayList();
1966             }
1967             else
1968             {
1969                        criteria.add(ModelStatementPeer.USR, getId());
1970                        collModelStatements = ModelStatementPeer.doSelect(criteria, con);
1971              }
1972          }
1973          else
1974          {
1975              // criteria has no effect for a new object
1976              if (!isNew())
1977              {
1978                  // the following code is to determine if a new query is
1979                  // called for.  If the criteria is the same as the last
1980                  // one, just return the collection.
1981                        criteria.add(ModelStatementPeer.USR, getId());
1982                        if (!lastModelStatementsCriteria.equals(criteria))
1983                  {
1984                      collModelStatements = ModelStatementPeer.doSelect(criteria, con);
1985                  }
1986              }
1987          }
1988          lastModelStatementsCriteria = criteria;
1989 
1990          return collModelStatements;
1991      }
1992 
1993                               
1994               
1995                     
1996                               
1997                                 
1998                                                               
1999                                         
2000                     
2001                     
2002           
2003     /***
2004      * If this collection has already been initialized with
2005      * an identical criteria, it returns the collection.
2006      * Otherwise if this RdfUser is new, it will return
2007      * an empty collection; or if this RdfUser has previously
2008      * been saved, it will retrieve related ModelStatements from storage.
2009      *
2010      * This method is protected by default in order to keep the public
2011      * api reasonable.  You can provide public methods for those you
2012      * actually need in RdfUser.
2013      */
2014     protected List getModelStatementsJoinRdfUser(Criteria criteria)
2015         throws TorqueException
2016     {
2017         if (collModelStatements == null)
2018         {
2019             if (isNew())
2020             {
2021                collModelStatements = new ArrayList();
2022             }
2023             else
2024             {
2025                             criteria.add(ModelStatementPeer.USR, getId());
2026                             collModelStatements = ModelStatementPeer.doSelectJoinRdfUser(criteria);
2027             }
2028         }
2029         else
2030         {
2031             // the following code is to determine if a new query is
2032             // called for.  If the criteria is the same as the last
2033             // one, just return the collection.
2034             boolean newCriteria = true;
2035                         criteria.add(ModelStatementPeer.USR, getId());
2036                         if (!lastModelStatementsCriteria.equals(criteria))
2037             {
2038                 collModelStatements = ModelStatementPeer.doSelectJoinRdfUser(criteria);
2039             }
2040         }
2041         lastModelStatementsCriteria = criteria;
2042 
2043         return collModelStatements;
2044     }
2045                   
2046                     
2047                     
2048                                 
2049                                                               
2050                                         
2051                     
2052                     
2053           
2054     /***
2055      * If this collection has already been initialized with
2056      * an identical criteria, it returns the collection.
2057      * Otherwise if this RdfUser is new, it will return
2058      * an empty collection; or if this RdfUser has previously
2059      * been saved, it will retrieve related ModelStatements from storage.
2060      *
2061      * This method is protected by default in order to keep the public
2062      * api reasonable.  You can provide public methods for those you
2063      * actually need in RdfUser.
2064      */
2065     protected List getModelStatementsJoinModel(Criteria criteria)
2066         throws TorqueException
2067     {
2068         if (collModelStatements == null)
2069         {
2070             if (isNew())
2071             {
2072                collModelStatements = new ArrayList();
2073             }
2074             else
2075             {
2076                             criteria.add(ModelStatementPeer.USR, getId());
2077                             collModelStatements = ModelStatementPeer.doSelectJoinModel(criteria);
2078             }
2079         }
2080         else
2081         {
2082             // the following code is to determine if a new query is
2083             // called for.  If the criteria is the same as the last
2084             // one, just return the collection.
2085             boolean newCriteria = true;
2086                         criteria.add(ModelStatementPeer.USR, getId());
2087                         if (!lastModelStatementsCriteria.equals(criteria))
2088             {
2089                 collModelStatements = ModelStatementPeer.doSelectJoinModel(criteria);
2090             }
2091         }
2092         lastModelStatementsCriteria = criteria;
2093 
2094         return collModelStatements;
2095     }
2096                   
2097                     
2098                     
2099                                 
2100                                                               
2101                                         
2102                     
2103                     
2104           
2105     /***
2106      * If this collection has already been initialized with
2107      * an identical criteria, it returns the collection.
2108      * Otherwise if this RdfUser is new, it will return
2109      * an empty collection; or if this RdfUser has previously
2110      * been saved, it will retrieve related ModelStatements from storage.
2111      *
2112      * This method is protected by default in order to keep the public
2113      * api reasonable.  You can provide public methods for those you
2114      * actually need in RdfUser.
2115      */
2116     protected List getModelStatementsJoinRdfStatement(Criteria criteria)
2117         throws TorqueException
2118     {
2119         if (collModelStatements == null)
2120         {
2121             if (isNew())
2122             {
2123                collModelStatements = new ArrayList();
2124             }
2125             else
2126             {
2127                             criteria.add(ModelStatementPeer.USR, getId());
2128                             collModelStatements = ModelStatementPeer.doSelectJoinRdfStatement(criteria);
2129             }
2130         }
2131         else
2132         {
2133             // the following code is to determine if a new query is
2134             // called for.  If the criteria is the same as the last
2135             // one, just return the collection.
2136             boolean newCriteria = true;
2137                         criteria.add(ModelStatementPeer.USR, getId());
2138                         if (!lastModelStatementsCriteria.equals(criteria))
2139             {
2140                 collModelStatements = ModelStatementPeer.doSelectJoinRdfStatement(criteria);
2141             }
2142         }
2143         lastModelStatementsCriteria = criteria;
2144 
2145         return collModelStatements;
2146     }
2147                             
2148 
2149 
2150                           
2151             
2152     /***
2153      * Collection to store aggregation of collRdfToolbars
2154      */
2155     protected List collRdfToolbars;
2156 
2157     /***
2158      * Temporary storage of collRdfToolbars to save a possible db hit in
2159      * the event objects are add to the collection, but the
2160      * complete collection is never requested.
2161      */
2162     protected void initRdfToolbars()
2163     {
2164         if (collRdfToolbars == null)
2165         {
2166             collRdfToolbars = new ArrayList();
2167         }
2168     }
2169 
2170     /***
2171      * Method called to associate a RdfToolbar object to this object
2172      * through the RdfToolbar foreign key attribute
2173      *
2174      * @param l RdfToolbar
2175      * @throws TorqueException
2176      */
2177     public void addRdfToolbar(RdfToolbar l) throws TorqueException
2178     {
2179         getRdfToolbars().add(l);
2180         l.setRdfUser((RdfUser) this);
2181     }
2182 
2183     /***
2184      * The criteria used to select the current contents of collRdfToolbars
2185      */
2186     private Criteria lastRdfToolbarsCriteria = null;
2187 
2188     /***
2189      * If this collection has already been initialized, returns
2190      * the collection. Otherwise returns the results of
2191      * getRdfToolbars(new Criteria())
2192      *
2193      * @throws TorqueException
2194      */
2195     public List getRdfToolbars() throws TorqueException
2196     {
2197         if (collRdfToolbars == null)
2198         {
2199             collRdfToolbars = getRdfToolbars(new Criteria(10));
2200         }
2201         return collRdfToolbars;
2202     }
2203 
2204     /***
2205      * If this collection has already been initialized with
2206      * an identical criteria, it returns the collection.
2207      * Otherwise if this RdfUser has previously
2208      * been saved, it will retrieve related RdfToolbars from storage.
2209      * If this RdfUser is new, it will return
2210      * an empty collection or the current collection, the criteria
2211      * is ignored on a new object.
2212      *
2213      * @throws TorqueException
2214      */
2215     public List getRdfToolbars(Criteria criteria) throws TorqueException
2216     {
2217         if (collRdfToolbars == null)
2218         {
2219             if (isNew())
2220             {
2221                collRdfToolbars = new ArrayList();
2222             }
2223             else
2224             {
2225                       criteria.add(RdfToolbarPeer.USR, getId() );
2226                       collRdfToolbars = RdfToolbarPeer.doSelect(criteria);
2227             }
2228         }
2229         else
2230         {
2231             // criteria has no effect for a new object
2232             if (!isNew())
2233             {
2234                 // the following code is to determine if a new query is
2235                 // called for.  If the criteria is the same as the last
2236                 // one, just return the collection.
2237                       criteria.add(RdfToolbarPeer.USR, getId());
2238                       if (!lastRdfToolbarsCriteria.equals(criteria))
2239                 {
2240                     collRdfToolbars = RdfToolbarPeer.doSelect(criteria);
2241                 }
2242             }
2243         }
2244         lastRdfToolbarsCriteria = criteria;
2245 
2246         return collRdfToolbars;
2247     }
2248 
2249     /***
2250      * If this collection has already been initialized, returns
2251      * the collection. Otherwise returns the results of
2252      * getRdfToolbars(new Criteria(),Connection)
2253      * This method takes in the Connection also as input so that
2254      * referenced objects can also be obtained using a Connection
2255      * that is taken as input
2256      */
2257     public List getRdfToolbars(Connection con) throws TorqueException
2258     {
2259         if (collRdfToolbars == null)
2260         {
2261             collRdfToolbars = getRdfToolbars(new Criteria(10), con);
2262         }
2263         return collRdfToolbars;
2264     }
2265 
2266     /***
2267      * If this collection has already been initialized with
2268      * an identical criteria, it returns the collection.
2269      * Otherwise if this RdfUser has previously
2270      * been saved, it will retrieve related RdfToolbars from storage.
2271      * If this RdfUser is new, it will return
2272      * an empty collection or the current collection, the criteria
2273      * is ignored on a new object.
2274      * This method takes in the Connection also as input so that
2275      * referenced objects can also be obtained using a Connection
2276      * that is taken as input
2277      */
2278     public List getRdfToolbars(Criteria criteria, Connection con)
2279             throws TorqueException
2280     {
2281         if (collRdfToolbars == null)
2282         {
2283             if (isNew())
2284             {
2285                collRdfToolbars = new ArrayList();
2286             }
2287             else
2288             {
2289                        criteria.add(RdfToolbarPeer.USR, getId());
2290                        collRdfToolbars = RdfToolbarPeer.doSelect(criteria, con);
2291              }
2292          }
2293          else
2294          {
2295              // criteria has no effect for a new object
2296              if (!isNew())
2297              {
2298                  // the following code is to determine if a new query is
2299                  // called for.  If the criteria is the same as the last
2300                  // one, just return the collection.
2301                        criteria.add(RdfToolbarPeer.USR, getId());
2302                        if (!lastRdfToolbarsCriteria.equals(criteria))
2303                  {
2304                      collRdfToolbars = RdfToolbarPeer.doSelect(criteria, con);
2305                  }
2306              }
2307          }
2308          lastRdfToolbarsCriteria = criteria;
2309 
2310          return collRdfToolbars;
2311      }
2312 
2313                   
2314               
2315                     
2316                               
2317                                 
2318                                                               
2319                                         
2320                     
2321                     
2322           
2323     /***
2324      * If this collection has already been initialized with
2325      * an identical criteria, it returns the collection.
2326      * Otherwise if this RdfUser is new, it will return
2327      * an empty collection; or if this RdfUser has previously
2328      * been saved, it will retrieve related RdfToolbars from storage.
2329      *
2330      * This method is protected by default in order to keep the public
2331      * api reasonable.  You can provide public methods for those you
2332      * actually need in RdfUser.
2333      */
2334     protected List getRdfToolbarsJoinRdfUser(Criteria criteria)
2335         throws TorqueException
2336     {
2337         if (collRdfToolbars == null)
2338         {
2339             if (isNew())
2340             {
2341                collRdfToolbars = new ArrayList();
2342             }
2343             else
2344             {
2345                             criteria.add(RdfToolbarPeer.USR, getId());
2346                             collRdfToolbars = RdfToolbarPeer.doSelectJoinRdfUser(criteria);
2347             }
2348         }
2349         else
2350         {
2351             // the following code is to determine if a new query is
2352             // called for.  If the criteria is the same as the last
2353             // one, just return the collection.
2354             boolean newCriteria = true;
2355                         criteria.add(RdfToolbarPeer.USR, getId());
2356                         if (!lastRdfToolbarsCriteria.equals(criteria))
2357             {
2358                 collRdfToolbars = RdfToolbarPeer.doSelectJoinRdfUser(criteria);
2359             }
2360         }
2361         lastRdfToolbarsCriteria = criteria;
2362 
2363         return collRdfToolbars;
2364     }
2365                             
2366 
2367 
2368           
2369     private static List fieldNames = null;
2370 
2371     /***
2372      * Generate a list of field names.
2373      *
2374      * @return a list of field names
2375      */
2376     public static synchronized List getFieldNames()
2377     {
2378         if (fieldNames == null)
2379         {
2380             fieldNames = new ArrayList();
2381               fieldNames.add("Id");
2382               fieldNames.add("FirstName");
2383               fieldNames.add("LastName");
2384               fieldNames.add("Description");
2385               fieldNames.add("Login");
2386               fieldNames.add("Password");
2387               fieldNames.add("Email");
2388               fieldNames.add("LastAccess");
2389               fieldNames.add("SessionKey");
2390               fieldNames.add("GroupId");
2391               fieldNames = Collections.unmodifiableList(fieldNames);
2392         }
2393         return fieldNames;
2394     }
2395 
2396     /***
2397      * Retrieves a field from the object by name passed in as a String.
2398      *
2399      * @param name field name
2400      * @return value
2401      */
2402     public Object getByName(String name)
2403     {
2404           if (name.equals("Id"))
2405         {
2406                 return new Integer(getId());
2407             }
2408           if (name.equals("FirstName"))
2409         {
2410                 return getFirstName();
2411             }
2412           if (name.equals("LastName"))
2413         {
2414                 return getLastName();
2415             }
2416           if (name.equals("Description"))
2417         {
2418                 return getDescription();
2419             }
2420           if (name.equals("Login"))
2421         {
2422                 return getLogin();
2423             }
2424           if (name.equals("Password"))
2425         {
2426                 return getPassword();
2427             }
2428           if (name.equals("Email"))
2429         {
2430                 return getEmail();
2431             }
2432           if (name.equals("LastAccess"))
2433         {
2434                 return getLastAccess();
2435             }
2436           if (name.equals("SessionKey"))
2437         {
2438                 return new Long(getSessionKey());
2439             }
2440           if (name.equals("GroupId"))
2441         {
2442                 return new Integer(getGroupId());
2443             }
2444           return null;
2445     }
2446     
2447     /***
2448      * Retrieves a field from the object by name passed in
2449      * as a String.  The String must be one of the static
2450      * Strings defined in this Class' Peer.
2451      *
2452      * @param name peer name
2453      * @return value
2454      */
2455     public Object getByPeerName(String name)
2456     {
2457           if (name.equals(RdfUserPeer.ID))
2458         {
2459                 return new Integer(getId());
2460             }
2461           if (name.equals(RdfUserPeer.FIRST_NAME))
2462         {
2463                 return getFirstName();
2464             }
2465           if (name.equals(RdfUserPeer.LAST_NAME))
2466         {
2467                 return getLastName();
2468             }
2469           if (name.equals(RdfUserPeer.DESCRIPTION))
2470         {
2471                 return getDescription();
2472             }
2473           if (name.equals(RdfUserPeer.LOGIN))
2474         {
2475                 return getLogin();
2476             }
2477           if (name.equals(RdfUserPeer.PASSWORD))
2478         {
2479                 return getPassword();
2480             }
2481           if (name.equals(RdfUserPeer.EMAIL))
2482         {
2483                 return getEmail();
2484             }
2485           if (name.equals(RdfUserPeer.LAST_ACCESS))
2486         {
2487                 return getLastAccess();
2488             }
2489           if (name.equals(RdfUserPeer.SESSION_KEY))
2490         {
2491                 return new Long(getSessionKey());
2492             }
2493           if (name.equals(RdfUserPeer.GROUP_ID))
2494         {
2495                 return new Integer(getGroupId());
2496             }
2497           return null;
2498     }
2499 
2500     /***
2501      * Retrieves a field from the object by Position as specified
2502      * in the xml schema.  Zero-based.
2503      *
2504      * @param pos position in xml schema
2505      * @return value
2506      */
2507     public Object getByPosition(int pos)
2508     {
2509             if (pos == 0)
2510         {
2511                 return new Integer(getId());
2512             }
2513               if (pos == 1)
2514         {
2515                 return getFirstName();
2516             }
2517               if (pos == 2)
2518         {
2519                 return getLastName();
2520             }
2521               if (pos == 3)
2522         {
2523                 return getDescription();
2524             }
2525               if (pos == 4)
2526         {
2527                 return getLogin();
2528             }
2529               if (pos == 5)
2530         {
2531                 return getPassword();
2532             }
2533               if (pos == 6)
2534         {
2535                 return getEmail();
2536             }
2537               if (pos == 7)
2538         {
2539                 return getLastAccess();
2540             }
2541               if (pos == 8)
2542         {
2543                 return new Long(getSessionKey());
2544             }
2545               if (pos == 9)
2546         {
2547                 return new Integer(getGroupId());
2548             }
2549               return null;
2550     }
2551      
2552     /***
2553      * Stores the object in the database.  If the object is new,
2554      * it inserts it; otherwise an update is performed.
2555      *
2556      * @throws Exception
2557      */
2558     public void save() throws Exception
2559     {
2560           save(RdfUserPeer.getMapBuilder()
2561                 .getDatabaseMap().getName());
2562       }
2563 
2564     /***
2565      * Stores the object in the database.  If the object is new,
2566      * it inserts it; otherwise an update is performed.
2567        * Note: this code is here because the method body is
2568      * auto-generated conditionally and therefore needs to be
2569      * in this file instead of in the super class, BaseObject.
2570        *
2571      * @param dbName
2572      * @throws TorqueException
2573      */
2574     public void save(String dbName) throws TorqueException
2575     {
2576         Connection con = null;
2577           try
2578         {
2579             con = Transaction.begin(dbName);
2580             save(con);
2581             Transaction.commit(con);
2582         }
2583         catch(TorqueException e)
2584         {
2585             Transaction.safeRollback(con);
2586             throw e;
2587         }
2588       }
2589 
2590       /*** flag to prevent endless save loop, if this object is referenced
2591         by another object which falls in this transaction. */
2592     private boolean alreadyInSave = false;
2593       /***
2594      * Stores the object in the database.  If the object is new,
2595      * it inserts it; otherwise an update is performed.  This method
2596      * is meant to be used as part of a transaction, otherwise use
2597      * the save() method and the connection details will be handled
2598      * internally
2599      *
2600      * @param con
2601      * @throws TorqueException
2602      */
2603     public void save(Connection con) throws TorqueException
2604     {
2605           if (!alreadyInSave)
2606         {
2607             alreadyInSave = true;
2608 
2609 
2610   
2611             // If this object has been modified, then save it to the database.
2612             if (isModified())
2613             {
2614                 if (isNew())
2615                 {
2616                     RdfUserPeer.doInsert((RdfUser) this, con);
2617                     setNew(false);
2618                 }
2619                 else
2620                 {
2621                     RdfUserPeer.doUpdate((RdfUser) this, con);
2622                 }
2623             }
2624 
2625                                       
2626                 
2627             if (collRdfLiterals != null)
2628             {
2629                 for (int i = 0; i < collRdfLiterals.size(); i++)
2630                 {
2631                     ((RdfLiteral) collRdfLiterals.get(i)).save(con);
2632                 }
2633             }
2634                                           
2635                 
2636             if (collRdfNamespaces != null)
2637             {
2638                 for (int i = 0; i < collRdfNamespaces.size(); i++)
2639                 {
2640                     ((RdfNamespace) collRdfNamespaces.get(i)).save(con);
2641                 }
2642             }
2643                                           
2644                 
2645             if (collRdfResources != null)
2646             {
2647                 for (int i = 0; i < collRdfResources.size(); i++)
2648                 {
2649                     ((RdfResource) collRdfResources.get(i)).save(con);
2650                 }
2651             }
2652                                           
2653                 
2654             if (collRdfStatements != null)
2655             {
2656                 for (int i = 0; i < collRdfStatements.size(); i++)
2657                 {
2658                     ((RdfStatement) collRdfStatements.get(i)).save(con);
2659                 }
2660             }
2661                                           
2662                 
2663             if (collModels != null)
2664             {
2665                 for (int i = 0; i < collModels.size(); i++)
2666                 {
2667                     ((Model) collModels.get(i)).save(con);
2668                 }
2669             }
2670                                           
2671                 
2672             if (collModelStatements != null)
2673             {
2674                 for (int i = 0; i < collModelStatements.size(); i++)
2675                 {
2676                     ((ModelStatement) collModelStatements.get(i)).save(con);
2677                 }
2678             }
2679                                           
2680                 
2681             if (collRdfToolbars != null)
2682             {
2683                 for (int i = 0; i < collRdfToolbars.size(); i++)
2684                 {
2685                     ((RdfToolbar) collRdfToolbars.get(i)).save(con);
2686                 }
2687             }
2688                           alreadyInSave = false;
2689         }
2690       }
2691 
2692 
2693                           
2694       /***
2695      * Set the PrimaryKey using ObjectKey.
2696      *
2697      * @param  id ObjectKey
2698      */
2699     public void setPrimaryKey(ObjectKey key)
2700         throws TorqueException
2701     {
2702             setId(((NumberKey) key).intValue());
2703         }
2704 
2705     /***
2706      * Set the PrimaryKey using a String.
2707      *
2708      * @param key
2709      */
2710     public void setPrimaryKey(String key) throws TorqueException
2711     {
2712             setId(Integer.parseInt(key));
2713         }
2714 
2715   
2716     /***
2717      * returns an id that differentiates this object from others
2718      * of its class.
2719      */
2720     public ObjectKey getPrimaryKey()
2721     {
2722           return SimpleKey.keyFor(getId());
2723       }
2724 
2725  
2726 
2727     /***
2728      * Makes a copy of this object.
2729      * It creates a new object filling in the simple attributes.
2730        * It then fills all the association collections and sets the
2731      * related objects to isNew=true.
2732        */
2733       public RdfUser copy() throws TorqueException
2734     {
2735         return copyInto(new RdfUser());
2736     }
2737   
2738     protected RdfUser copyInto(RdfUser copyObj) throws TorqueException
2739     {
2740           copyObj.setId(id);
2741           copyObj.setFirstName(firstName);
2742           copyObj.setLastName(lastName);
2743           copyObj.setDescription(description);
2744           copyObj.setLogin(login);
2745           copyObj.setPassword(password);
2746           copyObj.setEmail(email);
2747           copyObj.setLastAccess(lastAccess);
2748           copyObj.setSessionKey(sessionKey);
2749           copyObj.setGroupId(groupId);
2750   
2751                     copyObj.setId(0);
2752                                                                   
2753                                       
2754                 
2755         List v = getRdfLiterals();
2756         for (int i = 0; i < v.size(); i++)
2757         {
2758             RdfLiteral obj = (RdfLiteral) v.get(i);
2759             copyObj.addRdfLiteral(obj.copy());
2760         }
2761                                                   
2762                 
2763         v = getRdfNamespaces();
2764         for (int i = 0; i < v.size(); i++)
2765         {
2766             RdfNamespace obj = (RdfNamespace) v.get(i);
2767             copyObj.addRdfNamespace(obj.copy());
2768         }
2769                                                   
2770                 
2771         v = getRdfResources();
2772         for (int i = 0; i < v.size(); i++)
2773         {
2774             RdfResource obj = (RdfResource) v.get(i);
2775             copyObj.addRdfResource(obj.copy());
2776         }
2777                                                   
2778                 
2779         v = getRdfStatements();
2780         for (int i = 0; i < v.size(); i++)
2781         {
2782             RdfStatement obj = (RdfStatement) v.get(i);
2783             copyObj.addRdfStatement(obj.copy());
2784         }
2785                                                   
2786                 
2787         v = getModels();
2788         for (int i = 0; i < v.size(); i++)
2789         {
2790             Model obj = (Model) v.get(i);
2791             copyObj.addModel(obj.copy());
2792         }
2793                                                   
2794                 
2795         v = getModelStatements();
2796         for (int i = 0; i < v.size(); i++)
2797         {
2798             ModelStatement obj = (ModelStatement) v.get(i);
2799             copyObj.addModelStatement(obj.copy());
2800         }
2801                                                   
2802                 
2803         v = getRdfToolbars();
2804         for (int i = 0; i < v.size(); i++)
2805         {
2806             RdfToolbar obj = (RdfToolbar) v.get(i);
2807             copyObj.addRdfToolbar(obj.copy());
2808         }
2809                     
2810         return copyObj;
2811     }
2812 
2813     /***
2814      * returns a peer instance associated with this om.  Since Peer classes
2815      * are not to have any instance attributes, this method returns the
2816      * same instance for all member of this class. The method could therefore
2817      * be static, but this would prevent one from overriding the behavior.
2818      */
2819     public RdfUserPeer getPeer()
2820     {
2821         return peer;
2822     }
2823 
2824     public String toString()
2825     {
2826         StringBuffer str = new StringBuffer();
2827         str.append("RdfUser:\n");
2828         str.append("Id = ")
2829            .append(getId())
2830            .append("\n");
2831         str.append("FirstName = ")
2832            .append(getFirstName())
2833            .append("\n");
2834         str.append("LastName = ")
2835            .append(getLastName())
2836            .append("\n");
2837         str.append("Description = ")
2838            .append(getDescription())
2839            .append("\n");
2840         str.append("Login = ")
2841            .append(getLogin())
2842            .append("\n");
2843         str.append("Password = ")
2844            .append(getPassword())
2845            .append("\n");
2846         str.append("Email = ")
2847            .append(getEmail())
2848            .append("\n");
2849         str.append("LastAccess = ")
2850            .append(getLastAccess())
2851            .append("\n");
2852         str.append("SessionKey = ")
2853            .append(getSessionKey())
2854            .append("\n");
2855         str.append("GroupId = ")
2856            .append(getGroupId())
2857            .append("\n");
2858         return(str.toString());
2859     }
2860 }