1 package org.apache.turbine.services.security.torque.om;
2
3
4 import java.math.BigDecimal;
5 import java.sql.Connection;
6 import java.util.ArrayList;
7 import java.util.Collections;
8 import java.util.Date;
9 import java.util.List;
10
11 import org.apache.commons.lang.ObjectUtils;
12 import org.apache.torque.TorqueException;
13 import org.apache.torque.map.TableMap;
14 import org.apache.torque.om.BaseObject;
15 import org.apache.torque.om.ComboKey;
16 import org.apache.torque.om.DateKey;
17 import org.apache.torque.om.NumberKey;
18 import org.apache.torque.om.ObjectKey;
19 import org.apache.torque.om.SimpleKey;
20 import org.apache.torque.om.StringKey;
21 import org.apache.torque.om.Persistent;
22 import org.apache.torque.util.Criteria;
23 import org.apache.torque.util.Transaction;
24
25
26
27
28
29
30
31
32
33
34
35
36
37 public abstract class BaseTurbineUser extends BaseObject
38 {
39
40 private static final long serialVersionUID = 1308842746584L;
41
42
43 private static final TurbineUserPeer peer =
44 new TurbineUserPeer();
45
46
47
48 private int userId;
49
50
51 private String userName;
52
53
54 private String password;
55
56
57 private String firstName;
58
59
60 private String lastName;
61
62
63 private String email;
64
65
66 private String confirmed;
67
68
69 private Date modified;
70
71
72 private Date createDate;
73
74
75 private Date lastLogin;
76
77
78 private byte[] objectdata;
79
80
81
82
83
84
85
86 public int getUserId()
87 {
88 return userId;
89 }
90
91
92
93
94
95
96
97 public void setUserId(int v) throws TorqueException
98 {
99
100 if (this.userId != v)
101 {
102 this.userId = v;
103 setModified(true);
104 }
105
106
107
108
109 if (collTurbineUserGroupRoles != null)
110 {
111 for (int i = 0; i < collTurbineUserGroupRoles.size(); i++)
112 {
113 ((TurbineUserGroupRole) collTurbineUserGroupRoles.get(i))
114 .setUserId(v);
115 }
116 }
117 }
118
119
120
121
122
123
124 public String getUserName()
125 {
126 return userName;
127 }
128
129
130
131
132
133
134
135 public void setUserName(String v)
136 {
137
138 if (!ObjectUtils.equals(this.userName, v))
139 {
140 this.userName = v;
141 setModified(true);
142 }
143
144
145 }
146
147
148
149
150
151
152 public String getPassword()
153 {
154 return password;
155 }
156
157
158
159
160
161
162
163 public void setPassword(String v)
164 {
165
166 if (!ObjectUtils.equals(this.password, v))
167 {
168 this.password = v;
169 setModified(true);
170 }
171
172
173 }
174
175
176
177
178
179
180 public String getFirstName()
181 {
182 return firstName;
183 }
184
185
186
187
188
189
190
191 public void setFirstName(String v)
192 {
193
194 if (!ObjectUtils.equals(this.firstName, v))
195 {
196 this.firstName = v;
197 setModified(true);
198 }
199
200
201 }
202
203
204
205
206
207
208 public String getLastName()
209 {
210 return lastName;
211 }
212
213
214
215
216
217
218
219 public void setLastName(String v)
220 {
221
222 if (!ObjectUtils.equals(this.lastName, v))
223 {
224 this.lastName = v;
225 setModified(true);
226 }
227
228
229 }
230
231
232
233
234
235
236 public String getEmail()
237 {
238 return email;
239 }
240
241
242
243
244
245
246
247 public void setEmail(String v)
248 {
249
250 if (!ObjectUtils.equals(this.email, v))
251 {
252 this.email = v;
253 setModified(true);
254 }
255
256
257 }
258
259
260
261
262
263
264 public String getConfirmed()
265 {
266 return confirmed;
267 }
268
269
270
271
272
273
274
275 public void setConfirmed(String v)
276 {
277
278 if (!ObjectUtils.equals(this.confirmed, v))
279 {
280 this.confirmed = v;
281 setModified(true);
282 }
283
284
285 }
286
287
288
289
290
291
292 public Date getModified()
293 {
294 return modified;
295 }
296
297
298
299
300
301
302
303 public void setModified(Date v)
304 {
305
306 if (!ObjectUtils.equals(this.modified, v))
307 {
308 this.modified = v;
309 setModified(true);
310 }
311
312
313 }
314
315
316
317
318
319
320 public Date getCreateDate()
321 {
322 return createDate;
323 }
324
325
326
327
328
329
330
331 public void setCreateDate(Date v)
332 {
333
334 if (!ObjectUtils.equals(this.createDate, v))
335 {
336 this.createDate = v;
337 setModified(true);
338 }
339
340
341 }
342
343
344
345
346
347
348 public Date getLastLogin()
349 {
350 return lastLogin;
351 }
352
353
354
355
356
357
358
359 public void setLastLogin(Date v)
360 {
361
362 if (!ObjectUtils.equals(this.lastLogin, v))
363 {
364 this.lastLogin = v;
365 setModified(true);
366 }
367
368
369 }
370
371
372
373
374
375
376 public byte[] getObjectdata()
377 {
378 return objectdata;
379 }
380
381
382
383
384
385
386
387 public void setObjectdata(byte[] v)
388 {
389
390 if (!ObjectUtils.equals(this.objectdata, v))
391 {
392 this.objectdata = v;
393 setModified(true);
394 }
395
396
397 }
398
399
400
401
402
403
404
405 protected List<TurbineUserGroupRole> collTurbineUserGroupRoles;
406
407
408
409
410
411
412 protected void initTurbineUserGroupRoles()
413 {
414 if (collTurbineUserGroupRoles == null)
415 {
416 collTurbineUserGroupRoles = new ArrayList<TurbineUserGroupRole>();
417 }
418 }
419
420
421
422
423
424
425
426
427
428 public void addTurbineUserGroupRole(TurbineUserGroupRole l) throws TorqueException
429 {
430 getTurbineUserGroupRoles().add(l);
431 l.setTurbineUser((TurbineUser) this);
432 }
433
434
435
436
437
438
439
440
441 public void addTurbineUserGroupRole(TurbineUserGroupRole l, Connection con) throws TorqueException
442 {
443 getTurbineUserGroupRoles(con).add(l);
444 l.setTurbineUser((TurbineUser) this);
445 }
446
447
448
449
450 private Criteria lastTurbineUserGroupRolesCriteria = null;
451
452
453
454
455
456
457
458
459
460 public List<TurbineUserGroupRole> getTurbineUserGroupRoles()
461 throws TorqueException
462 {
463 if (collTurbineUserGroupRoles == null)
464 {
465 collTurbineUserGroupRoles = getTurbineUserGroupRoles(new Criteria(10));
466 }
467 return collTurbineUserGroupRoles;
468 }
469
470
471
472
473
474
475
476
477
478
479
480
481 public List<TurbineUserGroupRole> getTurbineUserGroupRoles(Criteria criteria) throws TorqueException
482 {
483 if (collTurbineUserGroupRoles == null)
484 {
485 if (isNew())
486 {
487 collTurbineUserGroupRoles = new ArrayList<TurbineUserGroupRole>();
488 }
489 else
490 {
491 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId() );
492 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria);
493 }
494 }
495 else
496 {
497
498 if (!isNew())
499 {
500
501
502
503 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
504 if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
505 {
506 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria);
507 }
508 }
509 }
510 lastTurbineUserGroupRolesCriteria = criteria;
511
512 return collTurbineUserGroupRoles;
513 }
514
515
516
517
518
519
520
521
522
523 public List<TurbineUserGroupRole> getTurbineUserGroupRoles(Connection con) throws TorqueException
524 {
525 if (collTurbineUserGroupRoles == null)
526 {
527 collTurbineUserGroupRoles = getTurbineUserGroupRoles(new Criteria(10), con);
528 }
529 return collTurbineUserGroupRoles;
530 }
531
532
533
534
535
536
537
538
539
540
541
542
543
544 public List<TurbineUserGroupRole> getTurbineUserGroupRoles(Criteria criteria, Connection con)
545 throws TorqueException
546 {
547 if (collTurbineUserGroupRoles == null)
548 {
549 if (isNew())
550 {
551 collTurbineUserGroupRoles = new ArrayList<TurbineUserGroupRole>();
552 }
553 else
554 {
555 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
556 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria, con);
557 }
558 }
559 else
560 {
561
562 if (!isNew())
563 {
564
565
566
567 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
568 if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
569 {
570 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelect(criteria, con);
571 }
572 }
573 }
574 lastTurbineUserGroupRolesCriteria = criteria;
575
576 return collTurbineUserGroupRoles;
577 }
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600 protected List<TurbineUserGroupRole> getTurbineUserGroupRolesJoinTurbineUser(Criteria criteria)
601 throws TorqueException
602 {
603 if (collTurbineUserGroupRoles == null)
604 {
605 if (isNew())
606 {
607 collTurbineUserGroupRoles = new ArrayList<TurbineUserGroupRole>();
608 }
609 else
610 {
611 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
612 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineUser(criteria);
613 }
614 }
615 else
616 {
617
618
619
620 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
621 if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
622 {
623 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineUser(criteria);
624 }
625 }
626 lastTurbineUserGroupRolesCriteria = criteria;
627
628 return collTurbineUserGroupRoles;
629 }
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650 protected List<TurbineUserGroupRole> getTurbineUserGroupRolesJoinTurbineGroup(Criteria criteria)
651 throws TorqueException
652 {
653 if (collTurbineUserGroupRoles == null)
654 {
655 if (isNew())
656 {
657 collTurbineUserGroupRoles = new ArrayList<TurbineUserGroupRole>();
658 }
659 else
660 {
661 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
662 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineGroup(criteria);
663 }
664 }
665 else
666 {
667
668
669
670 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
671 if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
672 {
673 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineGroup(criteria);
674 }
675 }
676 lastTurbineUserGroupRolesCriteria = criteria;
677
678 return collTurbineUserGroupRoles;
679 }
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700 protected List<TurbineUserGroupRole> getTurbineUserGroupRolesJoinTurbineRole(Criteria criteria)
701 throws TorqueException
702 {
703 if (collTurbineUserGroupRoles == null)
704 {
705 if (isNew())
706 {
707 collTurbineUserGroupRoles = new ArrayList<TurbineUserGroupRole>();
708 }
709 else
710 {
711 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
712 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineRole(criteria);
713 }
714 }
715 else
716 {
717
718
719
720 criteria.add(TurbineUserGroupRolePeer.USER_ID, getUserId());
721 if (!lastTurbineUserGroupRolesCriteria.equals(criteria))
722 {
723 collTurbineUserGroupRoles = TurbineUserGroupRolePeer.doSelectJoinTurbineRole(criteria);
724 }
725 }
726 lastTurbineUserGroupRolesCriteria = criteria;
727
728 return collTurbineUserGroupRoles;
729 }
730
731
732
733
734 private static List<String> fieldNames = null;
735
736
737
738
739
740
741 public static synchronized List<String> getFieldNames()
742 {
743 if (fieldNames == null)
744 {
745 fieldNames = new ArrayList<String>();
746 fieldNames.add("UserId");
747 fieldNames.add("UserName");
748 fieldNames.add("Password");
749 fieldNames.add("FirstName");
750 fieldNames.add("LastName");
751 fieldNames.add("Email");
752 fieldNames.add("Confirmed");
753 fieldNames.add("Modified");
754 fieldNames.add("CreateDate");
755 fieldNames.add("LastLogin");
756 fieldNames.add("Objectdata");
757 fieldNames = Collections.unmodifiableList(fieldNames);
758 }
759 return fieldNames;
760 }
761
762
763
764
765
766
767
768 public Object getByName(String name)
769 {
770 if (name.equals("UserId"))
771 {
772 return new Integer(getUserId());
773 }
774 if (name.equals("UserName"))
775 {
776 return getUserName();
777 }
778 if (name.equals("Password"))
779 {
780 return getPassword();
781 }
782 if (name.equals("FirstName"))
783 {
784 return getFirstName();
785 }
786 if (name.equals("LastName"))
787 {
788 return getLastName();
789 }
790 if (name.equals("Email"))
791 {
792 return getEmail();
793 }
794 if (name.equals("Confirmed"))
795 {
796 return getConfirmed();
797 }
798 if (name.equals("Modified"))
799 {
800 return getModified();
801 }
802 if (name.equals("CreateDate"))
803 {
804 return getCreateDate();
805 }
806 if (name.equals("LastLogin"))
807 {
808 return getLastLogin();
809 }
810 if (name.equals("Objectdata"))
811 {
812 return getObjectdata();
813 }
814 return null;
815 }
816
817
818
819
820
821
822
823
824
825
826 public boolean setByName(String name, Object value )
827 throws TorqueException, IllegalArgumentException
828 {
829 if (name.equals("UserId"))
830 {
831 if (value == null || ! (Integer.class.isInstance(value)))
832 {
833 throw new IllegalArgumentException("setByName: value parameter was null or not an Integer object.");
834 }
835 setUserId(((Integer) value).intValue());
836 return true;
837 }
838 if (name.equals("UserName"))
839 {
840
841 if (value != null && ! String.class.isInstance(value))
842 {
843 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
844 }
845 setUserName((String) value);
846 return true;
847 }
848 if (name.equals("Password"))
849 {
850
851 if (value != null && ! String.class.isInstance(value))
852 {
853 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
854 }
855 setPassword((String) value);
856 return true;
857 }
858 if (name.equals("FirstName"))
859 {
860
861 if (value != null && ! String.class.isInstance(value))
862 {
863 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
864 }
865 setFirstName((String) value);
866 return true;
867 }
868 if (name.equals("LastName"))
869 {
870
871 if (value != null && ! String.class.isInstance(value))
872 {
873 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
874 }
875 setLastName((String) value);
876 return true;
877 }
878 if (name.equals("Email"))
879 {
880
881 if (value != null && ! String.class.isInstance(value))
882 {
883 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
884 }
885 setEmail((String) value);
886 return true;
887 }
888 if (name.equals("Confirmed"))
889 {
890
891 if (value != null && ! String.class.isInstance(value))
892 {
893 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
894 }
895 setConfirmed((String) value);
896 return true;
897 }
898 if (name.equals("Modified"))
899 {
900
901 if (value != null && ! Date.class.isInstance(value))
902 {
903 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
904 }
905 setModified((Date) value);
906 return true;
907 }
908 if (name.equals("CreateDate"))
909 {
910
911 if (value != null && ! Date.class.isInstance(value))
912 {
913 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
914 }
915 setCreateDate((Date) value);
916 return true;
917 }
918 if (name.equals("LastLogin"))
919 {
920
921 if (value != null && ! Date.class.isInstance(value))
922 {
923 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
924 }
925 setLastLogin((Date) value);
926 return true;
927 }
928 if (name.equals("Objectdata"))
929 {
930
931 if (value != null && ! byte[].class.isInstance(value))
932 {
933 throw new IllegalArgumentException("Invalid type of object specified for value in setByName");
934 }
935 setObjectdata((byte[]) value);
936 return true;
937 }
938 return false;
939 }
940
941
942
943
944
945
946
947
948
949 public Object getByPeerName(String name)
950 {
951 if (name.equals(TurbineUserPeer.USER_ID))
952 {
953 return new Integer(getUserId());
954 }
955 if (name.equals(TurbineUserPeer.LOGIN_NAME))
956 {
957 return getUserName();
958 }
959 if (name.equals(TurbineUserPeer.PASSWORD_VALUE))
960 {
961 return getPassword();
962 }
963 if (name.equals(TurbineUserPeer.FIRST_NAME))
964 {
965 return getFirstName();
966 }
967 if (name.equals(TurbineUserPeer.LAST_NAME))
968 {
969 return getLastName();
970 }
971 if (name.equals(TurbineUserPeer.EMAIL))
972 {
973 return getEmail();
974 }
975 if (name.equals(TurbineUserPeer.CONFIRM_VALUE))
976 {
977 return getConfirmed();
978 }
979 if (name.equals(TurbineUserPeer.MODIFIED))
980 {
981 return getModified();
982 }
983 if (name.equals(TurbineUserPeer.CREATED))
984 {
985 return getCreateDate();
986 }
987 if (name.equals(TurbineUserPeer.LAST_LOGIN))
988 {
989 return getLastLogin();
990 }
991 if (name.equals(TurbineUserPeer.OBJECTDATA))
992 {
993 return getObjectdata();
994 }
995 return null;
996 }
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007 public boolean setByPeerName(String name, Object value)
1008 throws TorqueException, IllegalArgumentException
1009 {
1010 if (TurbineUserPeer.USER_ID.equals(name))
1011 {
1012 return setByName("UserId", value);
1013 }
1014 if (TurbineUserPeer.LOGIN_NAME.equals(name))
1015 {
1016 return setByName("UserName", value);
1017 }
1018 if (TurbineUserPeer.PASSWORD_VALUE.equals(name))
1019 {
1020 return setByName("Password", value);
1021 }
1022 if (TurbineUserPeer.FIRST_NAME.equals(name))
1023 {
1024 return setByName("FirstName", value);
1025 }
1026 if (TurbineUserPeer.LAST_NAME.equals(name))
1027 {
1028 return setByName("LastName", value);
1029 }
1030 if (TurbineUserPeer.EMAIL.equals(name))
1031 {
1032 return setByName("Email", value);
1033 }
1034 if (TurbineUserPeer.CONFIRM_VALUE.equals(name))
1035 {
1036 return setByName("Confirmed", value);
1037 }
1038 if (TurbineUserPeer.MODIFIED.equals(name))
1039 {
1040 return setByName("Modified", value);
1041 }
1042 if (TurbineUserPeer.CREATED.equals(name))
1043 {
1044 return setByName("CreateDate", value);
1045 }
1046 if (TurbineUserPeer.LAST_LOGIN.equals(name))
1047 {
1048 return setByName("LastLogin", value);
1049 }
1050 if (TurbineUserPeer.OBJECTDATA.equals(name))
1051 {
1052 return setByName("Objectdata", value);
1053 }
1054 return false;
1055 }
1056
1057
1058
1059
1060
1061
1062
1063
1064 public Object getByPosition(int pos)
1065 {
1066 if (pos == 0)
1067 {
1068 return new Integer(getUserId());
1069 }
1070 if (pos == 1)
1071 {
1072 return getUserName();
1073 }
1074 if (pos == 2)
1075 {
1076 return getPassword();
1077 }
1078 if (pos == 3)
1079 {
1080 return getFirstName();
1081 }
1082 if (pos == 4)
1083 {
1084 return getLastName();
1085 }
1086 if (pos == 5)
1087 {
1088 return getEmail();
1089 }
1090 if (pos == 6)
1091 {
1092 return getConfirmed();
1093 }
1094 if (pos == 7)
1095 {
1096 return getModified();
1097 }
1098 if (pos == 8)
1099 {
1100 return getCreateDate();
1101 }
1102 if (pos == 9)
1103 {
1104 return getLastLogin();
1105 }
1106 if (pos == 10)
1107 {
1108 return getObjectdata();
1109 }
1110 return null;
1111 }
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122 public boolean setByPosition(int position, Object value)
1123 throws TorqueException, IllegalArgumentException
1124 {
1125 if (position == 0)
1126 {
1127 return setByName("UserId", value);
1128 }
1129 if (position == 1)
1130 {
1131 return setByName("UserName", value);
1132 }
1133 if (position == 2)
1134 {
1135 return setByName("Password", value);
1136 }
1137 if (position == 3)
1138 {
1139 return setByName("FirstName", value);
1140 }
1141 if (position == 4)
1142 {
1143 return setByName("LastName", value);
1144 }
1145 if (position == 5)
1146 {
1147 return setByName("Email", value);
1148 }
1149 if (position == 6)
1150 {
1151 return setByName("Confirmed", value);
1152 }
1153 if (position == 7)
1154 {
1155 return setByName("Modified", value);
1156 }
1157 if (position == 8)
1158 {
1159 return setByName("CreateDate", value);
1160 }
1161 if (position == 9)
1162 {
1163 return setByName("LastLogin", value);
1164 }
1165 if (position == 10)
1166 {
1167 return setByName("Objectdata", value);
1168 }
1169 return false;
1170 }
1171
1172
1173
1174
1175
1176
1177
1178 public void save() throws Exception
1179 {
1180 save(TurbineUserPeer.DATABASE_NAME);
1181 }
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193 public void save(String dbName) throws TorqueException
1194 {
1195 Connection con = null;
1196 try
1197 {
1198 con = Transaction.begin(dbName);
1199 save(con);
1200 Transaction.commit(con);
1201 }
1202 catch(TorqueException e)
1203 {
1204 Transaction.safeRollback(con);
1205 throw e;
1206 }
1207 }
1208
1209
1210
1211 private boolean alreadyInSave = false;
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222 public void save(Connection con) throws TorqueException
1223 {
1224 if (!alreadyInSave)
1225 {
1226 alreadyInSave = true;
1227
1228
1229
1230
1231 if (isModified())
1232 {
1233 if (isNew())
1234 {
1235 TurbineUserPeer.doInsert((TurbineUser) this, con);
1236 setNew(false);
1237 }
1238 else
1239 {
1240 TurbineUserPeer.doUpdate((TurbineUser) this, con);
1241 }
1242 }
1243
1244
1245 if (collTurbineUserGroupRoles != null)
1246 {
1247 for (int i = 0; i < collTurbineUserGroupRoles.size(); i++)
1248 {
1249 ((TurbineUserGroupRole) collTurbineUserGroupRoles.get(i)).save(con);
1250 }
1251 }
1252 alreadyInSave = false;
1253 }
1254 }
1255
1256
1257
1258
1259
1260
1261
1262 public void setPrimaryKey(ObjectKey key)
1263 throws TorqueException
1264 {
1265 setUserId(((NumberKey) key).intValue());
1266 }
1267
1268
1269
1270
1271
1272
1273 public void setPrimaryKey(String key) throws TorqueException
1274 {
1275 setUserId(Integer.parseInt(key));
1276 }
1277
1278
1279
1280
1281
1282
1283 public ObjectKey getPrimaryKey()
1284 {
1285 return SimpleKey.keyFor(getUserId());
1286 }
1287
1288
1289
1290
1291
1292
1293
1294
1295 public TurbineUser copy() throws TorqueException
1296 {
1297 return copy(true);
1298 }
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308 public TurbineUser copy(Connection con) throws TorqueException
1309 {
1310 return copy(true, con);
1311 }
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322 public TurbineUser copy(boolean deepcopy) throws TorqueException
1323 {
1324 return copyInto(new TurbineUser(), deepcopy);
1325 }
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337 public TurbineUser copy(boolean deepcopy, Connection con) throws TorqueException
1338 {
1339 return copyInto(new TurbineUser(), deepcopy, con);
1340 }
1341
1342
1343
1344
1345
1346
1347
1348 protected TurbineUser copyInto(TurbineUser copyObj) throws TorqueException
1349 {
1350 return copyInto(copyObj, true);
1351 }
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361 protected TurbineUser copyInto(TurbineUser copyObj, Connection con) throws TorqueException
1362 {
1363 return copyInto(copyObj, true, con);
1364 }
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374 protected TurbineUser copyInto(TurbineUser copyObj, boolean deepcopy) throws TorqueException
1375 {
1376 copyObj.setUserId(userId);
1377 copyObj.setUserName(userName);
1378 copyObj.setPassword(password);
1379 copyObj.setFirstName(firstName);
1380 copyObj.setLastName(lastName);
1381 copyObj.setEmail(email);
1382 copyObj.setConfirmed(confirmed);
1383 copyObj.setModified(modified);
1384 copyObj.setCreateDate(createDate);
1385 copyObj.setLastLogin(lastLogin);
1386 copyObj.setObjectdata(objectdata);
1387
1388 copyObj.setUserId( 0);
1389
1390 if (deepcopy)
1391 {
1392
1393
1394 List<TurbineUserGroupRole> vTurbineUserGroupRoles = getTurbineUserGroupRoles();
1395 if (vTurbineUserGroupRoles != null)
1396 {
1397 for (int i = 0; i < vTurbineUserGroupRoles.size(); i++)
1398 {
1399 TurbineUserGroupRole obj = vTurbineUserGroupRoles.get(i);
1400 copyObj.addTurbineUserGroupRole(obj.copy());
1401 }
1402 }
1403 else
1404 {
1405 copyObj.collTurbineUserGroupRoles = null;
1406 }
1407 }
1408 return copyObj;
1409 }
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421 protected TurbineUser copyInto(TurbineUser copyObj, boolean deepcopy, Connection con) throws TorqueException
1422 {
1423 copyObj.setUserId(userId);
1424 copyObj.setUserName(userName);
1425 copyObj.setPassword(password);
1426 copyObj.setFirstName(firstName);
1427 copyObj.setLastName(lastName);
1428 copyObj.setEmail(email);
1429 copyObj.setConfirmed(confirmed);
1430 copyObj.setModified(modified);
1431 copyObj.setCreateDate(createDate);
1432 copyObj.setLastLogin(lastLogin);
1433 copyObj.setObjectdata(objectdata);
1434
1435 copyObj.setUserId( 0);
1436
1437 if (deepcopy)
1438 {
1439
1440
1441 List<TurbineUserGroupRole> vTurbineUserGroupRoles = getTurbineUserGroupRoles(con);
1442 if (vTurbineUserGroupRoles != null)
1443 {
1444 for (int i = 0; i < vTurbineUserGroupRoles.size(); i++)
1445 {
1446 TurbineUserGroupRole obj = vTurbineUserGroupRoles.get(i);
1447 copyObj.addTurbineUserGroupRole(obj.copy(con), con);
1448 }
1449 }
1450 else
1451 {
1452 copyObj.collTurbineUserGroupRoles = null;
1453 }
1454 }
1455 return copyObj;
1456 }
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466 public TurbineUserPeer getPeer()
1467 {
1468 return peer;
1469 }
1470
1471
1472
1473
1474
1475
1476
1477 public TableMap getTableMap() throws TorqueException
1478 {
1479 return TurbineUserPeer.getTableMap();
1480 }
1481
1482
1483 public String toString()
1484 {
1485 StringBuffer str = new StringBuffer();
1486 str.append("TurbineUser:\n");
1487 str.append("UserId = ")
1488 .append(getUserId())
1489 .append("\n");
1490 str.append("UserName = ")
1491 .append(getUserName())
1492 .append("\n");
1493 str.append("Password = ")
1494 .append(getPassword())
1495 .append("\n");
1496 str.append("FirstName = ")
1497 .append(getFirstName())
1498 .append("\n");
1499 str.append("LastName = ")
1500 .append(getLastName())
1501 .append("\n");
1502 str.append("Email = ")
1503 .append(getEmail())
1504 .append("\n");
1505 str.append("Confirmed = ")
1506 .append(getConfirmed())
1507 .append("\n");
1508 str.append("Modified = ")
1509 .append(getModified())
1510 .append("\n");
1511 str.append("CreateDate = ")
1512 .append(getCreateDate())
1513 .append("\n");
1514 str.append("LastLogin = ")
1515 .append(getLastLogin())
1516 .append("\n");
1517 str.append("Objectdata = ")
1518 .append("<binary>")
1519 .append("\n");
1520 return(str.toString());
1521 }
1522 }