1 package org.apache.turbine.services.schedule;
2
3 import java.sql.Connection;
4 import java.sql.SQLException;
5 import java.sql.ResultSet;
6 import java.io.IOException;
7 import java.io.InputStream;
8 import java.util.ArrayList;
9 import java.util.Collection;
10 import java.util.Date;
11 import java.util.Iterator;
12 import java.util.List;
13
14 import org.apache.commons.logging.Log;
15 import org.apache.commons.logging.LogFactory;
16 import org.apache.torque.NoRowsException;
17 import org.apache.torque.TooManyRowsException;
18 import org.apache.torque.Column;
19 import org.apache.torque.Torque;
20 import org.apache.torque.TorqueException;
21 import org.apache.torque.TorqueRuntimeException;
22 import org.apache.torque.adapter.IDMethod;
23 import org.apache.torque.criteria.Criteria;
24 import org.apache.torque.map.DatabaseMap;
25 import org.apache.torque.map.TableMap;
26 import org.apache.torque.map.ColumnMap;
27 import org.apache.torque.map.ForeignKeyMap;
28 import org.apache.torque.map.InheritanceMap;
29 import org.apache.torque.om.mapper.RecordMapper;
30 import org.apache.torque.om.mapper.CompositeMapper;
31 import org.apache.torque.om.DateKey;
32 import org.apache.torque.om.NumberKey;
33 import org.apache.torque.om.StringKey;
34 import org.apache.torque.om.ObjectKey;
35 import org.apache.torque.om.SimpleKey;
36 import org.apache.torque.util.Transaction;
37 import org.apache.torque.util.ColumnValues;
38 import org.apache.torque.util.JdbcTypedValue;
39
40
41
42
43
44
45
46
47
48
49
50
51 public abstract class BaseJobEntryTorquePeer
52 {
53
54 private static Log log = LogFactory.getLog(BaseJobEntryTorquePeerImpl.class);
55
56 public static final String DATABASE_NAME;
57
58
59 public static final String TABLE_NAME;
60
61
62 public static final TableMap TABLE;
63
64 public static final ColumnMap JOB_ID;
65
66 public static final ColumnMap SECOND;
67
68 public static final ColumnMap MINUTE;
69
70 public static final ColumnMap HOUR;
71
72 public static final ColumnMap WEEK_DAY;
73
74 public static final ColumnMap DAY_OF_MONTH;
75
76 public static final ColumnMap TASK;
77
78 public static final ColumnMap EMAIL;
79
80 public static final ColumnMap PROPERTY;
81
82
83 public static final int numColumns = 9;
84
85
86
87 private static JobEntryTorquePeerImpl jobEntryTorquePeerImpl;
88
89
90 static
91 {
92 DatabaseMap dbMap = Torque.getOrCreateDatabase("default")
93 .getDatabaseMap();
94 if (dbMap.getTable("TURBINE_SCHEDULED_JOB") == null)
95 {
96 dbMap.addTable("TURBINE_SCHEDULED_JOB");
97 }
98 DATABASE_NAME = "default";
99 TABLE_NAME = "TURBINE_SCHEDULED_JOB";
100
101 TABLE = dbMap.getTable("TURBINE_SCHEDULED_JOB");
102 TABLE.setJavaName("JobEntryTorque");
103 TABLE.setOMClass(org.apache.turbine.services.schedule.JobEntryTorque.class);
104 TABLE.setPeerClass(org.apache.turbine.services.schedule.JobEntryTorquePeer.class);
105 TABLE.setPrimaryKeyMethod(IDMethod.ID_BROKER);
106 TABLE.setPrimaryKeyMethodInfo(IDMethod.ID_BROKER, TABLE.getName());
107 TABLE.setPrimaryKeyMethodInfo(IDMethod.SEQUENCE, "$sequenceName");
108 TABLE.setPrimaryKeyMethodInfo(IDMethod.AUTO_INCREMENT, "TURBINE_SCHEDULED_JOB");
109 TABLE.setUseInheritance(true);
110
111
112
113 JOB_ID = new ColumnMap("JOB_ID", TABLE);
114 JOB_ID.setType(Integer.valueOf(0));
115 JOB_ID.setTorqueType("INTEGER");
116 JOB_ID.setUsePrimitive(true);
117 JOB_ID.setPrimaryKey(true);
118 JOB_ID.setNotNull(true);
119 JOB_ID.setJavaName("JobId");
120 JOB_ID.setAutoIncrement(true);
121 JOB_ID.setProtected(false);
122 JOB_ID.setJavaType( "int" );
123 JOB_ID.setPosition(1);
124 TABLE.addColumn(JOB_ID);
125
126 SECOND = new ColumnMap("SECOND", TABLE);
127 SECOND.setType(Integer.valueOf(0));
128 SECOND.setTorqueType("INTEGER");
129 SECOND.setUsePrimitive(true);
130 SECOND.setPrimaryKey(false);
131 SECOND.setNotNull(true);
132 SECOND.setJavaName("Second");
133 SECOND.setAutoIncrement(true);
134 SECOND.setProtected(false);
135 SECOND.setJavaType( "int" );
136 SECOND.setDefault("-1");
137 SECOND.setPosition(2);
138 TABLE.addColumn(SECOND);
139
140 MINUTE = new ColumnMap("MINUTE", TABLE);
141 MINUTE.setType(Integer.valueOf(0));
142 MINUTE.setTorqueType("INTEGER");
143 MINUTE.setUsePrimitive(true);
144 MINUTE.setPrimaryKey(false);
145 MINUTE.setNotNull(true);
146 MINUTE.setJavaName("Minute");
147 MINUTE.setAutoIncrement(true);
148 MINUTE.setProtected(false);
149 MINUTE.setJavaType( "int" );
150 MINUTE.setDefault("-1");
151 MINUTE.setPosition(3);
152 TABLE.addColumn(MINUTE);
153
154 HOUR = new ColumnMap("HOUR", TABLE);
155 HOUR.setType(Integer.valueOf(0));
156 HOUR.setTorqueType("INTEGER");
157 HOUR.setUsePrimitive(true);
158 HOUR.setPrimaryKey(false);
159 HOUR.setNotNull(true);
160 HOUR.setJavaName("Hour");
161 HOUR.setAutoIncrement(true);
162 HOUR.setProtected(false);
163 HOUR.setJavaType( "int" );
164 HOUR.setDefault("-1");
165 HOUR.setPosition(4);
166 TABLE.addColumn(HOUR);
167
168 WEEK_DAY = new ColumnMap("WEEK_DAY", TABLE);
169 WEEK_DAY.setType(Integer.valueOf(0));
170 WEEK_DAY.setTorqueType("INTEGER");
171 WEEK_DAY.setUsePrimitive(true);
172 WEEK_DAY.setPrimaryKey(false);
173 WEEK_DAY.setNotNull(true);
174 WEEK_DAY.setJavaName("WeekDay");
175 WEEK_DAY.setAutoIncrement(true);
176 WEEK_DAY.setProtected(false);
177 WEEK_DAY.setJavaType( "int" );
178 WEEK_DAY.setDefault("-1");
179 WEEK_DAY.setPosition(5);
180 TABLE.addColumn(WEEK_DAY);
181
182 DAY_OF_MONTH = new ColumnMap("DAY_OF_MONTH", TABLE);
183 DAY_OF_MONTH.setType(Integer.valueOf(0));
184 DAY_OF_MONTH.setTorqueType("INTEGER");
185 DAY_OF_MONTH.setUsePrimitive(true);
186 DAY_OF_MONTH.setPrimaryKey(false);
187 DAY_OF_MONTH.setNotNull(true);
188 DAY_OF_MONTH.setJavaName("DayOfMonth");
189 DAY_OF_MONTH.setAutoIncrement(true);
190 DAY_OF_MONTH.setProtected(false);
191 DAY_OF_MONTH.setJavaType( "int" );
192 DAY_OF_MONTH.setDefault("-1");
193 DAY_OF_MONTH.setPosition(6);
194 TABLE.addColumn(DAY_OF_MONTH);
195
196 TASK = new ColumnMap("TASK", TABLE);
197 TASK.setType("");
198 TASK.setTorqueType("VARCHAR");
199 TASK.setUsePrimitive(false);
200 TASK.setPrimaryKey(false);
201 TASK.setNotNull(true);
202 TASK.setJavaName("Task");
203 TASK.setAutoIncrement(true);
204 TASK.setProtected(false);
205 TASK.setJavaType( "String" );
206 TASK.setSize(99);
207 TASK.setPosition(7);
208 TABLE.addColumn(TASK);
209
210 EMAIL = new ColumnMap("EMAIL", TABLE);
211 EMAIL.setType("");
212 EMAIL.setTorqueType("VARCHAR");
213 EMAIL.setUsePrimitive(false);
214 EMAIL.setPrimaryKey(false);
215 EMAIL.setNotNull(false);
216 EMAIL.setJavaName("Email");
217 EMAIL.setAutoIncrement(true);
218 EMAIL.setProtected(false);
219 EMAIL.setJavaType( "String" );
220 EMAIL.setSize(99);
221 EMAIL.setPosition(8);
222 TABLE.addColumn(EMAIL);
223
224 PROPERTY = new ColumnMap("PROPERTY", TABLE);
225 PROPERTY.setType(new Object());
226 PROPERTY.setTorqueType("VARBINARY");
227 PROPERTY.setUsePrimitive(false);
228 PROPERTY.setPrimaryKey(false);
229 PROPERTY.setNotNull(false);
230 PROPERTY.setJavaName("Property");
231 PROPERTY.setAutoIncrement(true);
232 PROPERTY.setProtected(false);
233 PROPERTY.setJavaType( "byte[]" );
234 PROPERTY.setPosition(9);
235 TABLE.addColumn(PROPERTY);
236
237
238
239 initDatabaseMap();
240 }
241
242
243
244
245
246
247 protected static JobEntryTorquePeerImpl createJobEntryTorquePeerImpl()
248 {
249 JobEntryTorquePeerImpl instance = new JobEntryTorquePeerImpl();
250 return instance;
251 }
252
253
254
255
256
257
258
259
260 public static JobEntryTorquePeerImpl getJobEntryTorquePeerImpl()
261 {
262 JobEntryTorquePeerImpl peerImplInstance = jobEntryTorquePeerImpl;
263 if (peerImplInstance == null)
264 {
265 peerImplInstance = JobEntryTorquePeer.createJobEntryTorquePeerImpl();
266 jobEntryTorquePeerImpl = peerImplInstance;
267 }
268 return peerImplInstance;
269 }
270
271
272
273
274
275
276
277
278
279 public static void setJobEntryTorquePeerImpl(JobEntryTorquePeerImpl peerImplInstance)
280 {
281 jobEntryTorquePeerImpl = peerImplInstance;
282 }
283
284
285
286
287
288
289
290
291
292 public static void addSelectColumns(Criteria criteria)
293 throws TorqueException
294 {
295 getJobEntryTorquePeerImpl().addSelectColumns(criteria);
296 }
297
298
299
300
301
302
303
304
305
306
307
308
309
310 public static void correctBooleans(Criteria criteria) throws TorqueException
311 {
312 getJobEntryTorquePeerImpl().correctBooleans(criteria);
313 }
314
315
316
317
318
319
320
321
322
323
324
325
326
327 public static void correctBooleans(
328 ColumnValues columnValues)
329 throws TorqueException
330 {
331 getJobEntryTorquePeerImpl().correctBooleans(columnValues);
332 }
333
334
335
336
337
338
339
340
341
342
343
344 public static List<JobEntryTorque> doSelect(Criteria criteria)
345 throws TorqueException
346 {
347 return getJobEntryTorquePeerImpl().doSelect(criteria);
348 }
349
350
351
352
353
354
355
356
357
358
359
360
361
362 public static List<JobEntryTorque> doSelect(
363 Criteria criteria,
364 Connection connection)
365 throws TorqueException
366 {
367 return getJobEntryTorquePeerImpl().doSelect(criteria, connection);
368 }
369
370
371
372
373
374
375
376
377
378
379
380
381 public static <T> List<T> doSelect(
382 Criteria criteria,
383 RecordMapper<T> mapper)
384 throws TorqueException
385 {
386 return getJobEntryTorquePeerImpl().doSelect(criteria, mapper);
387 }
388
389
390
391
392
393
394
395
396
397
398
399
400
401 public static <T> List<T> doSelect(
402 Criteria criteria,
403 RecordMapper<T> mapper,
404 Connection connection)
405 throws TorqueException
406 {
407 return getJobEntryTorquePeerImpl().doSelect(
408 criteria,
409 mapper,
410 connection);
411 }
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426 public static <T> List<T> doSelect(
427 String query,
428 RecordMapper<T> mapper,
429 String dbName)
430 throws TorqueException
431 {
432 return getJobEntryTorquePeerImpl().doSelect(
433 query,
434 mapper,
435 dbName);
436 }
437
438
439
440
441
442
443
444
445
446
447
448
449
450 public static <T> List<T> doSelect(
451 String query,
452 RecordMapper<T> mapper,
453 Connection connection)
454 throws TorqueException
455 {
456 return getJobEntryTorquePeerImpl().doSelect(
457 query,
458 mapper,
459 connection);
460 }
461
462
463
464
465
466
467
468
469
470
471 public static List<JobEntryTorque> doSelect(JobEntryTorque obj)
472 throws TorqueException
473 {
474 return getJobEntryTorquePeerImpl().doSelect(obj);
475 }
476
477
478
479
480
481
482
483
484
485
486
487 public static JobEntryTorque doSelectSingleRecord(
488 Criteria criteria)
489 throws TorqueException
490 {
491 return getJobEntryTorquePeerImpl().doSelectSingleRecord(criteria);
492 }
493
494
495
496
497
498
499
500
501
502
503
504
505
506 public static JobEntryTorque doSelectSingleRecord(
507 Criteria criteria,
508 Connection connection)
509 throws TorqueException
510 {
511 return getJobEntryTorquePeerImpl().doSelectSingleRecord(criteria, connection);
512 }
513
514
515
516
517
518
519
520
521
522
523
524
525 public static <T> T doSelectSingleRecord(
526 org.apache.torque.criteria.Criteria criteria,
527 RecordMapper<T> mapper)
528 throws TorqueException
529 {
530 return getJobEntryTorquePeerImpl().doSelectSingleRecord(
531 criteria,
532 mapper);
533 }
534
535
536
537
538
539
540
541
542
543
544
545
546
547 public static <T> T doSelectSingleRecord(
548 org.apache.torque.criteria.Criteria criteria,
549 RecordMapper<T> mapper,
550 Connection connection)
551 throws TorqueException
552 {
553 return getJobEntryTorquePeerImpl().doSelectSingleRecord(
554 criteria,
555 mapper,
556 connection);
557 }
558
559
560
561
562
563
564
565
566
567
568 public static JobEntryTorque doSelectSingleRecord(
569 JobEntryTorque obj)
570 throws TorqueException
571 {
572 return getJobEntryTorquePeerImpl().doSelectSingleRecord(obj);
573 }
574
575
576
577
578
579 public static JobEntryTorque getDbObjectInstance()
580 {
581 return getJobEntryTorquePeerImpl().getDbObjectInstance();
582 }
583
584
585
586
587
588
589
590
591
592
593
594
595 public static ObjectKey doInsert(ColumnValues columnValues)
596 throws TorqueException
597 {
598 return getJobEntryTorquePeerImpl().doInsert(columnValues);
599 }
600
601
602
603
604
605
606
607
608
609
610
611
612
613 public static ObjectKey doInsert(ColumnValues columnValues, Connection con)
614 throws TorqueException
615 {
616 return getJobEntryTorquePeerImpl().doInsert(columnValues, con);
617 }
618
619
620
621
622
623
624 public static void doInsert(JobEntryTorque obj)
625 throws TorqueException
626 {
627 getJobEntryTorquePeerImpl().doInsert(obj);
628 }
629
630
631
632
633
634
635
636
637
638
639
640 public static void doInsert(JobEntryTorque obj, Connection con)
641 throws TorqueException
642 {
643 getJobEntryTorquePeerImpl().doInsert(obj, con);
644 }
645
646
647
648
649
650
651
652
653
654 public static int doUpdate(ColumnValues columnValues) throws TorqueException
655 {
656 return getJobEntryTorquePeerImpl().doUpdate(columnValues);
657 }
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673 public static int doUpdate(ColumnValues columnValues, Connection con)
674 throws TorqueException
675 {
676 return getJobEntryTorquePeerImpl().doUpdate(columnValues, con);
677 }
678
679
680
681
682
683
684
685
686
687
688
689
690
691 public static int doUpdate(
692 Criteria selectCriteria,
693 ColumnValues updateValues)
694 throws TorqueException
695 {
696 return getJobEntryTorquePeerImpl().doUpdate(
697 selectCriteria,
698 updateValues);
699 }
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714 public static int doUpdate(
715 Criteria criteria,
716 ColumnValues updateValues,
717 Connection connection)
718 throws TorqueException
719 {
720 return getJobEntryTorquePeerImpl().doUpdate(
721 criteria,
722 updateValues,
723 connection);
724 }
725
726
727
728
729
730
731
732
733
734
735
736
737 public static int doUpdate(JobEntryTorque obj) throws TorqueException
738 {
739 return getJobEntryTorquePeerImpl().doUpdate(obj);
740 }
741
742
743
744
745
746
747
748
749
750
751
752
753
754 public static int doUpdate(JobEntryTorque obj, Connection con)
755 throws TorqueException
756 {
757 return getJobEntryTorquePeerImpl().doUpdate(obj, con);
758 }
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773 public static int executeStatement(String statementString)
774 throws TorqueException
775 {
776 return getJobEntryTorquePeerImpl().executeStatement(statementString);
777 }
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794 public static int executeStatement(
795 String statementString,
796 List<JdbcTypedValue> replacementValues)
797 throws TorqueException
798 {
799 return getJobEntryTorquePeerImpl().executeStatement(
800 statementString,
801 replacementValues);
802 }
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821 public static int executeStatement(
822 String statementString,
823 String dbName,
824 List<JdbcTypedValue> replacementValues)
825 throws TorqueException
826 {
827 return getJobEntryTorquePeerImpl().executeStatement(
828 statementString,
829 dbName,
830 replacementValues);
831 }
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848 public static int executeStatement(
849 String statementString,
850 Connection con,
851 List<JdbcTypedValue> replacementValues)
852 throws TorqueException
853 {
854 return getJobEntryTorquePeerImpl().executeStatement(
855 statementString,
856 con,
857 replacementValues);
858 }
859
860
861
862
863
864
865
866
867
868
869
870 public static int doDelete(Criteria criteria) throws TorqueException
871 {
872 return getJobEntryTorquePeerImpl().doDelete(criteria);
873 }
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889 public static int doDelete(Criteria criteria, Connection con)
890 throws TorqueException
891 {
892 return getJobEntryTorquePeerImpl().doDelete(criteria, con);
893 }
894
895
896
897
898
899
900
901
902
903
904
905 public static int doDelete(JobEntryTorque obj) throws TorqueException
906 {
907 return getJobEntryTorquePeerImpl().doDelete(obj);
908 }
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924 public static int doDelete(JobEntryTorque obj, Connection con)
925 throws TorqueException
926 {
927 return getJobEntryTorquePeerImpl().doDelete(obj, con);
928 }
929
930
931
932
933
934
935
936
937
938
939
940
941 public static int doDelete(Collection<JobEntryTorque> objects)
942 throws TorqueException
943 {
944 return getJobEntryTorquePeerImpl().doDelete(objects);
945 }
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962 public static int doDelete(
963 Collection<JobEntryTorque> objects,
964 Connection con)
965 throws TorqueException
966 {
967 return getJobEntryTorquePeerImpl().doDelete(objects, con);
968 }
969
970
971
972
973
974
975
976
977
978
979
980 public static int doDelete(ObjectKey pk) throws TorqueException
981 {
982 return getJobEntryTorquePeerImpl().doDelete(pk);
983 }
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999 public static int doDelete(ObjectKey pk, Connection con)
1000 throws TorqueException
1001 {
1002 return getJobEntryTorquePeerImpl().doDelete(pk, con);
1003 }
1004
1005
1006
1007
1008
1009
1010
1011 public static Criteria buildCriteria(ObjectKey pk)
1012 {
1013 return getJobEntryTorquePeerImpl().buildCriteria(pk);
1014 }
1015
1016
1017
1018
1019
1020
1021
1022
1023 public static Criteria buildCriteria(Collection<ObjectKey> pks)
1024 {
1025 return getJobEntryTorquePeerImpl().buildCriteria(pks);
1026 }
1027
1028
1029
1030
1031
1032
1033
1034
1035 public static Criteria buildPkCriteria(
1036 Collection<JobEntryTorque> objects)
1037 {
1038 return getJobEntryTorquePeerImpl().buildPkCriteria(objects);
1039 }
1040
1041
1042
1043
1044
1045
1046 public static Criteria buildCriteria(JobEntryTorque obj)
1047 {
1048 return getJobEntryTorquePeerImpl().buildCriteria(obj);
1049 }
1050
1051
1052
1053
1054
1055
1056
1057 public static Criteria buildSelectCriteria(JobEntryTorque obj)
1058 {
1059 return getJobEntryTorquePeerImpl().buildSelectCriteria(obj);
1060 }
1061
1062
1063
1064
1065
1066
1067
1068 public static ColumnValues buildColumnValues(JobEntryTorque jobEntryTorque)
1069 throws TorqueException
1070 {
1071
1072 return getJobEntryTorquePeerImpl().buildColumnValues(jobEntryTorque);
1073 }
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084 public static JobEntryTorque retrieveByPK(int pk)
1085 throws TorqueException, NoRowsException, TooManyRowsException
1086 {
1087 return getJobEntryTorquePeerImpl().retrieveByPK(pk);
1088 }
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100 public static JobEntryTorque retrieveByPK(int pk, Connection con)
1101 throws TorqueException, NoRowsException, TooManyRowsException
1102 {
1103 return getJobEntryTorquePeerImpl().retrieveByPK(pk, con);
1104 }
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118 public static JobEntryTorque retrieveByPK(ObjectKey pk)
1119 throws TorqueException, NoRowsException, TooManyRowsException
1120 {
1121 return getJobEntryTorquePeerImpl().retrieveByPK(pk);
1122 }
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134 public static JobEntryTorque retrieveByPK(ObjectKey pk, Connection con)
1135 throws TorqueException, NoRowsException, TooManyRowsException
1136 {
1137 return getJobEntryTorquePeerImpl().retrieveByPK(pk, con);
1138 }
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148 public static List<JobEntryTorque> retrieveByPKs(Collection<ObjectKey> pks)
1149 throws TorqueException
1150 {
1151 return getJobEntryTorquePeerImpl().retrieveByPKs(pks);
1152 }
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162 public static List<JobEntryTorque> retrieveByPKs(Collection<ObjectKey> pks, Connection con)
1163 throws TorqueException
1164 {
1165 return getJobEntryTorquePeerImpl().retrieveByPKs(pks,con);
1166 }
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179 public static TableMap getTableMap()
1180 throws TorqueException
1181 {
1182 return getJobEntryTorquePeerImpl().getTableMap();
1183 }
1184
1185 public static void initDatabaseMap()
1186 {
1187 }
1188
1189
1190 }