KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > webdocwf > util > loader > CounterColumns


1 /**
2   CounterColumns - insert auto increment values in target counter columns.
3     Copyright (C) 2002-2003 Together
4     This library is free software; you can redistribute it and/or
5     modify it under the terms of the GNU Lesser General Public
6     License as published by the Free Software Foundation; either
7     version 2.1 of the License, or (at your option) any later version.
8     This library is distributed in the hope that it will be useful,
9     but WITHOUT ANY WARRANTY; without even the implied warranty of
10     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11     Lesser General Public License for more details.
12     You should have received a copy of the GNU Lesser General Public
13     License along with this library; if not, write to the Free Software
14     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
15  CounterColumns.java
16  Date: 11.03.2003.
17  @version 1.1.0
18  @author: Milosevic Sinisa sinisa@prozone.co.yu
19  @author: Radoslav Dutina rale@prozone.co.yu
20  */

21
22 package org.webdocwf.util.loader;
23
24 import java.util.Hashtable JavaDoc;
25 import java.util.Enumeration JavaDoc;
26 import java.util.Vector JavaDoc;
27 import org.w3c.dom.Document JavaDoc;
28 import org.w3c.dom.NodeList JavaDoc;
29 import org.w3c.dom.Node JavaDoc;
30 import org.w3c.dom.Element JavaDoc;
31 import org.w3c.dom.NamedNodeMap JavaDoc;
32 import java.sql.Connection JavaDoc;
33 import java.math.BigDecimal JavaDoc;
34 import java.sql.Statement JavaDoc;
35 import java.sql.SQLException JavaDoc;
36 import java.sql.ResultSet JavaDoc;
37 import org.webdocwf.util.loader.logging.Logger;
38
39 /**
40  *
41  * CounterColumns - insert auto increment values in target counter columns.
42  */

43 public class CounterColumns {
44
45   private String JavaDoc counterTableName = null;
46   private String JavaDoc counterNameColumn = null;
47   private String JavaDoc counterValueColumn = null;
48
49   private Hashtable JavaDoc counterName;
50   private Hashtable JavaDoc counterStartValue;
51   private Hashtable JavaDoc counterIncrement;
52   private Hashtable JavaDoc targetColumnName;
53   private Hashtable JavaDoc valueMode;
54   private Hashtable JavaDoc counterStartValueReset;
55   private Hashtable JavaDoc targetColumnTyp;
56
57 //subCounter columns
58
private Hashtable JavaDoc subCounterName;
59   private Hashtable JavaDoc subCounterStartValue;
60   private Hashtable JavaDoc subCounterIncrement;
61   private Hashtable JavaDoc subTargetColumnName;
62   private Hashtable JavaDoc subValueMode;
63   private Hashtable JavaDoc subCounterKeyColumns;
64   private Hashtable JavaDoc subCounterKeyValues;
65   private Hashtable JavaDoc subCounterKeyColumnsTyp;
66   private Hashtable JavaDoc subTargetColumnTyp;
67
68   private Vector JavaDoc vecCounterName = new Vector JavaDoc();
69   private Vector JavaDoc vecCounterIncrement = new Vector JavaDoc();
70   private Vector JavaDoc vecCounterStartValue = new Vector JavaDoc();
71   private Vector JavaDoc vecTargetColumnName = new Vector JavaDoc();
72   private Vector JavaDoc vecValueMode = new Vector JavaDoc();
73   private Vector JavaDoc vecCounterStartValueReset = new Vector JavaDoc();
74   private Vector JavaDoc vecTargetTableName = new Vector JavaDoc();
75   private Vector JavaDoc vecTargetTableID = new Vector JavaDoc();
76
77   private Vector JavaDoc vecSubCounterName = new Vector JavaDoc();
78   private Vector JavaDoc vecSubCounterIncrement = new Vector JavaDoc();
79   private Vector JavaDoc vecSubCounterStartValue = new Vector JavaDoc();
80   private Vector JavaDoc vecSubTargetTableName = new Vector JavaDoc();
81   private Vector JavaDoc vecSubTargetTableID = new Vector JavaDoc();
82   private Vector JavaDoc vecSubTargetColumnName = new Vector JavaDoc();
83   private Vector JavaDoc vecSubValueMode = new Vector JavaDoc();
84   private Vector JavaDoc vecSubKeyColumns = new Vector JavaDoc();
85   private Vector JavaDoc vecSubKeyColumnsTyp = new Vector JavaDoc();
86
87   private Hashtable JavaDoc currentCounterValue;
88
89   //caching the subcounter value
90
private Hashtable JavaDoc subCounterCache = new Hashtable JavaDoc();
91   private Logger logger;
92
93   /**
94    * Empty constructor of CounterColumns class
95    */

96   public CounterColumns() {
97
98     this.counterTableName = null;
99     this.counterNameColumn = null;
100     this.counterValueColumn = null;
101     this.counterName = new Hashtable JavaDoc();
102     this.counterStartValue = new Hashtable JavaDoc();
103     this.counterIncrement = new Hashtable JavaDoc();
104     this.targetColumnName = new Hashtable JavaDoc();
105     this.targetColumnTyp = new Hashtable JavaDoc();
106     this.valueMode = new Hashtable JavaDoc();
107     this.counterStartValueReset = new Hashtable JavaDoc();
108
109     this.subCounterName = new Hashtable JavaDoc();
110     this.subCounterStartValue = new Hashtable JavaDoc();
111     this.subCounterIncrement = new Hashtable JavaDoc();
112     this.subTargetColumnName = new Hashtable JavaDoc();
113     this.subValueMode = new Hashtable JavaDoc();
114     this.subCounterKeyColumns = new Hashtable JavaDoc();
115     this.subCounterKeyValues = new Hashtable JavaDoc();
116     this.subCounterKeyColumnsTyp = new Hashtable JavaDoc();
117     this.subTargetColumnTyp = new Hashtable JavaDoc();
118
119     this.vecCounterName = new Vector JavaDoc();
120     this.vecCounterIncrement = new Vector JavaDoc();
121     this.vecCounterStartValue = new Vector JavaDoc();
122     this.vecTargetColumnName = new Vector JavaDoc();
123     this.vecValueMode = new Vector JavaDoc();
124     this.vecCounterStartValueReset = new Vector JavaDoc();
125     this.vecTargetTableName = new Vector JavaDoc();
126     this.vecTargetTableID = new Vector JavaDoc();
127     this.currentCounterValue = new Hashtable JavaDoc();
128
129     this.vecSubCounterName = new Vector JavaDoc();
130     this.vecSubCounterIncrement = new Vector JavaDoc();
131     this.vecSubCounterStartValue = new Vector JavaDoc();
132     this.vecSubTargetTableName = new Vector JavaDoc();
133     this.vecSubTargetTableID = new Vector JavaDoc();
134     this.vecSubTargetColumnName = new Vector JavaDoc();
135     this.vecSubValueMode = new Vector JavaDoc();
136     this.vecSubKeyColumns = new Vector JavaDoc();
137     this.vecSubKeyColumnsTyp = new Vector JavaDoc();
138   }
139
140   /**
141    * This method set logger object
142    */

143   public void setLogger(Logger logger) {
144     this.logger = logger;
145   }
146
147   /**
148    * This method read value of counterTableName parameter
149    * @return string name of counter table
150    */

151   public String JavaDoc getCounterTableName() {
152     return this.counterTableName;
153   }
154
155   /**
156    * This method read value of counterValueColumn parameter
157    * @return String name of column in counter table with current values of each counter
158    */

159   public String JavaDoc getCounterValueColumn() {
160     return this.counterValueColumn;
161   }
162
163   /**
164    * This method read value of counterNameColumn parameter
165    * @return String name of column in counter table with counter names.
166    */

167   public String JavaDoc getCounterNameColumn() {
168     return this.counterNameColumn;
169   }
170
171   /**
172    * This method sets the value of counterNameColumn parameter
173    * @param nameColumn is name of the column
174    */

175   public void setCounterNameColumn(String JavaDoc nameColumn) {
176     this.counterNameColumn = nameColumn;
177   }
178
179   /**
180    * This method sets the value of counterValueColumn parameter
181    * @param valueColumn is value of the column
182    */

183   public void setCounterValueColumn(String JavaDoc valueColumn) {
184     this.counterValueColumn = valueColumn;
185   }
186
187   /**
188    * This method sets the value of counterTableName parameter
189    * @param tableName is table name
190    */

191   public void setCounterTableName(String JavaDoc tableName) {
192     this.counterTableName = tableName;
193   }
194
195   /**
196    * This method sets the value of:
197    * counterTableName, counterNameColumn and counterValueColumn parameters
198    * @param doc represents Object document
199    * @param importJob represents current import job
200    */

201   public void readConstantColumnAttributes(Document JavaDoc doc, int importJob) {
202     this.counterTableName = importAttributeValue(doc, "counterColumns", "counterTableName",
203                             importJob);
204     this.counterNameColumn = importAttributeValue(doc, "counterColumns", "counterNameColumn",
205                              importJob);
206     this.counterValueColumn = importAttributeValue(doc, "counterColumns", "counterValueColumn",
207                               importJob);
208   }
209
210   /**
211    * This method sets the value of next parameters:
212    * vecCounterName, vecCounterIncrement, vecCounterStartValue, vecTargetColumnName,
213    * vecValueMode, vecCounterStartValueReset, vecTargetTableName, vecTargetTableID,
214    * vecSubCounterName, vecSubCounterIncrement, vecSubCounterStartValue,
215    * vecSubTargetTableName, vecSubTargetTableID, vecSubTargetColumnName,
216    * vecSubValueMode and vecSubKeyColumns
217    * @param doc represents Object document
218    * @param importJob represents current import job
219    */

220   public void readConstantColumnsParameters(Document JavaDoc doc, int importJob) {
221     this.vecCounterName = importValue(doc, "counterColumn", "counterName", importJob, null);
222     this.vecCounterIncrement = importValue(doc, "counterColumn", "counterIncrement", importJob, "1");
223     this.vecCounterStartValue = importValue(doc, "counterColumn", "counterStartValue", importJob,
224                                 "0");
225     this.vecTargetColumnName = importValue(doc, "counterColumn", "targetColumnName", importJob, null);
226     this.vecValueMode = importValue(doc, "counterColumn", "valueMode", importJob, "setIfCreated");
227     this.vecCounterStartValueReset = importValue(doc, "counterColumn", "counterStartValueReset",
228                                      importJob, (new Boolean JavaDoc(false)).toString());
229     this.vecTargetTableName = importValue(doc, "counterColumn", "targetTableName", importJob, null);
230     this.vecTargetTableID = importValue(doc, "counterColumn", "targetTableID", importJob, null);
231
232     this.vecSubCounterName = importValue(doc, "subCounterColumn", "counterName", importJob, null);
233     this.vecSubCounterIncrement = importValue(doc, "subCounterColumn", "counterIncrement",
234                                   importJob, "1");
235     this.vecSubCounterStartValue = importValue(doc, "subCounterColumn", "counterStartValue",
236                                    importJob, "0");
237     this.vecSubTargetTableName = importValue(doc, "subCounterColumn", "targetTableName", importJob, null);
238     this.vecSubTargetTableID = importValue(doc, "subCounterColumn", "targetTableID", importJob, null);
239     this.vecSubTargetColumnName = importValue(doc, "subCounterColumn", "targetColumnName",
240                                   importJob, null);
241     this.vecSubValueMode = importValue(doc, "subCounterColumn", "valueMode", importJob,
242                            "setIfCreated");
243
244     for (int i = 0; i < this.vecSubCounterName.size(); i++) {
245       this.vecSubKeyColumns.addElement(importSubCounterKeyValue(doc, "keyColumnName", importJob, i));
246     }
247
248   }
249
250   /**
251    * This method sets the value of Constant Columns parameters
252    * @param tableName is table name
253    * @param tableID is table ID
254    */

255   public void setConstantColumnsParameters(String JavaDoc tableName, String JavaDoc tableID) {
256
257     Vector JavaDoc targetCounterName = new Vector JavaDoc();
258     Vector JavaDoc targetCounterIncrement = new Vector JavaDoc();
259     Vector JavaDoc targetCounterStartValue = new Vector JavaDoc();
260     Vector JavaDoc targetTargetColumnName = new Vector JavaDoc();
261     Vector JavaDoc targetValueMode = new Vector JavaDoc();
262     Vector JavaDoc targetCounterStartValueReset = new Vector JavaDoc();
263
264     Vector JavaDoc targetSubCounterName = new Vector JavaDoc();
265     Vector JavaDoc targetSubCounterIncrement = new Vector JavaDoc();
266     Vector JavaDoc targetSubCounterStartValue = new Vector JavaDoc();
267     Vector JavaDoc targetSubTargetColumnName = new Vector JavaDoc();
268     Vector JavaDoc targetSubValueMode = new Vector JavaDoc();
269     Vector JavaDoc targetSubKeyColumns = new Vector JavaDoc();
270     Vector JavaDoc subKeyColumnsKey = new Vector JavaDoc();
271
272     for (int i = 0; i < this.vecTargetTableName.size(); i++) {
273       if (tableName.equalsIgnoreCase(this.vecTargetTableName.get(i).toString()) &&
274           tableID.equalsIgnoreCase(this.vecTargetTableID.get(i).toString())) {
275         if (this.vecCounterName.get(i) != null)
276           targetCounterName.addElement(this.vecCounterName.get(i).toString());
277         else
278           targetCounterName.addElement(null);
279
280         if (this.vecCounterStartValue.get(i) != null)
281           targetCounterStartValue.addElement(this.vecCounterStartValue.get(i).toString());
282         else
283           targetCounterStartValue.addElement(null);
284
285         if (this.vecCounterIncrement.get(i) != null)
286           targetCounterIncrement.addElement(this.vecCounterIncrement.get(i).toString());
287         else
288           targetCounterIncrement.addElement(null);
289
290         if (this.vecTargetColumnName.get(i) != null)
291           targetTargetColumnName.addElement(this.vecTargetColumnName.get(i).toString());
292         else
293           targetTargetColumnName.addElement(null);
294
295         if (this.vecValueMode.get(i) != null)
296           targetValueMode.addElement(this.vecValueMode.get(i).toString());
297         else
298           targetValueMode.addElement(null);
299
300         if (this.vecCounterStartValueReset.get(i) != null)
301           targetCounterStartValueReset.addElement(this.vecCounterStartValueReset.get(i).toString());
302         else
303           targetCounterStartValueReset.addElement(null);
304
305 //sub counter columns
306
}
307     }
308     for (int i = 0; i < this.vecSubTargetTableName.size(); i++) {
309       if (tableName.equalsIgnoreCase(this.vecSubTargetTableName.get(i).toString()) &&
310           tableID.equalsIgnoreCase(this.vecSubTargetTableID.get(i).toString())) {
311         if (this.vecSubCounterName.get(i) != null) {
312           targetSubCounterName.addElement(this.vecSubCounterName.get(i).toString());
313         } else
314           targetSubCounterName.addElement(null);
315         if (this.vecSubCounterStartValue.get(i) != null)
316           targetSubCounterStartValue.addElement(this.vecSubCounterStartValue.get(i).toString());
317         else
318           targetSubCounterStartValue.addElement(null);
319         if (this.vecSubCounterIncrement.get(i) != null)
320           targetSubCounterIncrement.addElement(this.vecSubCounterIncrement.get(i).toString());
321         else
322           targetSubCounterIncrement.addElement(null);
323         if (this.vecSubTargetColumnName.get(i) != null)
324           targetSubTargetColumnName.addElement(this.vecSubTargetColumnName.get(i).toString());
325         else
326           targetSubTargetColumnName.addElement(null);
327         if (this.vecSubValueMode.get(i) != null)
328           targetSubValueMode.addElement(this.vecSubValueMode.get(i).toString());
329         else
330           targetSubValueMode.addElement(null);
331         if (this.vecSubKeyColumns.get(i) != null)
332           targetSubKeyColumns.addElement(this.vecSubKeyColumns.get(i));
333         else
334           targetSubKeyColumns.addElement(null);
335
336       }
337     }
338     this.counterName.put(tableName + "_" + tableID, targetCounterName);
339     this.counterIncrement.put(tableName + "_" + tableID, targetCounterIncrement);
340     this.counterStartValue.put(tableName + "_" + tableID, targetCounterStartValue);
341     this.targetColumnName.put(tableName + "_" + tableID, targetTargetColumnName);
342     this.valueMode.put(tableName + "_" + tableID, targetValueMode);
343     this.counterStartValueReset.put(tableName + "_" + tableID, targetCounterStartValueReset);
344
345 // subCounter columns
346
this.subCounterName.put(tableName + "_" + tableID, targetSubCounterName);
347     this.subCounterIncrement.put(tableName + "_" + tableID, targetSubCounterIncrement);
348     this.subCounterStartValue.put(tableName + "_" + tableID, targetSubCounterStartValue);
349     this.subTargetColumnName.put(tableName + "_" + tableID, targetSubTargetColumnName);
350     this.subValueMode.put(tableName + "_" + tableID, targetSubValueMode);
351     this.subCounterKeyColumns.put(tableName + "_" + tableID, targetSubKeyColumns);
352
353   }
354
355   private int getVectorsSize() {
356     if (this.vecCounterName != null)
357       return this.vecCounterName.size();
358     else
359       return 0;
360   }
361
362   /**
363    * This method read value of counterNames parameter
364    * @param tableName is table name
365    * @param tableID is table ID
366    * @return vector
367    */

368   public Vector JavaDoc getCounterName(String JavaDoc tableName, String JavaDoc tableID) {
369     return (Vector JavaDoc)this.counterName.get(tableName + "_" + tableID);
370   }
371
372   /**
373    * This method read value of counterIncrement parameter
374    * @param tableName is table name
375    * @param tableID is table ID
376    * @return Vector of increment values for all counter columns in table tableName.
377    */

378   public Vector JavaDoc getCounterIncrement(String JavaDoc tableName, String JavaDoc tableID) {
379     return (Vector JavaDoc)this.counterIncrement.get(tableName + "_" + tableID);
380   }
381
382   /**
383    * This method read value of counterStartValue parameter
384    * @param tableName is table name
385    * @param tableID is table ID
386    * @return Vector of start values for all counter columns in table tableName.
387    */

388   public Vector JavaDoc getCounterStartValue(String JavaDoc tableName, String JavaDoc tableID) {
389     return (Vector JavaDoc)this.counterStartValue.get(tableName + "_" + tableID);
390   }
391
392   /**
393    * This method read value of targetColumnName parameter
394    * @param tableName is table name
395    * @param tableID is table ID
396    * @return Vector of counter column names for all counter columns in table tableName.
397    */

398   public Vector JavaDoc getTargetColumnName(String JavaDoc tableName, String JavaDoc tableID) {
399     return (Vector JavaDoc)this.targetColumnName.get(tableName + "_" + tableID);
400
401   }
402
403   /**
404    * This method read value of targetColumnTyp parameter
405    * @param tableName is table name
406    * @param tableID is table ID
407    * @return Vector of counter column types for all counter columns in table tableName.
408    */

409   public Vector JavaDoc getTargetColumnTyp(String JavaDoc tableName, String JavaDoc tableID) {
410     return (Vector JavaDoc)this.targetColumnTyp.get(tableName + "_" + tableID);
411
412   }
413
414   /**
415    * This method read value of valueMode parameter
416    * @param tableName is table name
417    * @param tableID is table ID
418    * @return vector
419    */

420   public Vector JavaDoc getValueMode(String JavaDoc tableName, String JavaDoc tableID) {
421     return (Vector JavaDoc)this.valueMode.get(tableName + "_" + tableID);
422   }
423
424   /**
425    * This method read value of counterStartValueReset parameter
426    * @param tableName is table name
427    * @param tableID is table ID
428    * @return vector
429    */

430   public Vector JavaDoc getCounterStartValueReset(String JavaDoc tableName, String JavaDoc tableID) {
431     return (Vector JavaDoc)this.counterStartValueReset.get(tableName + "_" + tableID);
432   }
433
434 //subCounter columns
435
/**
436    * This method read value of subCounterName parameter
437    * @param tableName is table name
438    * @param tableID is table ID
439    * @return vector
440    */

441   public Vector JavaDoc getSubCounterName(String JavaDoc tableName, String JavaDoc tableID) {
442     return (Vector JavaDoc)this.subCounterName.get(tableName + "_" + tableID);
443   }
444
445   /**
446    * This method read value of getSubCounterIncrement parameter
447    * @param tableName is table name
448    * @param tableID is table ID
449    * @return vector
450    */

451   public Vector JavaDoc getSubCounterIncrement(String JavaDoc tableName, String JavaDoc tableID) {
452     return (Vector JavaDoc)this.subCounterIncrement.get(tableName + "_" + tableID);
453   }
454
455   /**
456    * This method read value of getSubCounterStartValue parameter
457    * @param tableName is table name
458    * @param tableID is table ID
459    * @return vector
460    */

461   public Vector JavaDoc getSubCounterStartValue(String JavaDoc tableName, String JavaDoc tableID) {
462     return (Vector JavaDoc)this.subCounterStartValue.get(tableName + "_" + tableID);
463   }
464
465   /**
466    * This method read value of subTargetColumnName parameter
467    * @param tableName is table name
468    * @param tableID is table ID
469    * @return vector
470    */

471   public Vector JavaDoc getSubTargetColumnName(String JavaDoc tableName, String JavaDoc tableID) {
472     return (Vector JavaDoc)this.subTargetColumnName.get(tableName + "_" + tableID);
473
474   }
475
476   /**
477    * This method read value of subTargetColumnTyp parameter
478    * @param tableName is table name
479    * @param tableID is table ID
480    * @return vector
481    */

482   public Vector JavaDoc getSubTargetColumnTyp(String JavaDoc tableName, String JavaDoc tableID) {
483     return (Vector JavaDoc)this.subTargetColumnTyp.get(tableName + "_" + tableID);
484
485   }
486
487   /**
488    * This method read value of subValueMode parameter
489    * @param tableName is table name
490    * @param tableID is table ID
491    * @return vector
492    */

493   public Vector JavaDoc getSubValueMode(String JavaDoc tableName, String JavaDoc tableID) {
494     return (Vector JavaDoc)this.subValueMode.get(tableName + "_" + tableID);
495   }
496
497   /**
498    * This method read value of subCounterKeyColumns parameter
499    * @param tableName is table name
500    * @param tableID is table ID
501    * @return vector
502    */

503   public Vector JavaDoc getSubCounterKeyColumns(String JavaDoc tableName, String JavaDoc tableID) {
504     return (Vector JavaDoc)this.subCounterKeyColumns.get(tableName + "_" + tableID);
505   }
506
507   /**
508    * This method read value of subCounterKeyColumnsTyp parameter
509    * @param tableName is table name
510    * @param tableID is table ID
511    * @return vector
512    */

513   public Vector JavaDoc getSubCounterKeyColumnsTyp(String JavaDoc tableName, String JavaDoc tableID) {
514     return (Vector JavaDoc)this.subCounterKeyColumnsTyp.get(tableName + "_" + tableID);
515   }
516
517   /**
518    * This method read value of subCounterKeyValues parameter
519    * @param tableName is table name
520    * @param tableID is table ID
521    * @return vector
522    */

523   public Vector JavaDoc getSubCounterKeyValues(String JavaDoc tableName, String JavaDoc tableID) {
524     return (Vector JavaDoc)this.subCounterKeyValues.get(tableName + "_" + tableID);
525   }
526
527   /**
528    * This method set value of subCounterKeyValues parameter
529    * @param tableName defines table name
530    * @param tableID defines table ID
531    * @param values is hashtable new key values
532    */

533   public void setSubCounterKeyValues(String JavaDoc tableName, String JavaDoc tableID, Hashtable JavaDoc values) {
534
535     Enumeration JavaDoc keys = values.keys();
536     Vector JavaDoc vecColumns = (Vector JavaDoc)this.subCounterKeyColumns.get(tableName + "_" + tableID);
537     Vector JavaDoc vecValues = new Vector JavaDoc(vecColumns.size());
538
539     String JavaDoc column;
540     for (int i = 0; i < vecColumns.size(); i++) {
541       Vector JavaDoc subValues = new Vector JavaDoc();
542       for (int j = 0; j < ( (Vector JavaDoc)vecColumns.get(i)).size(); j++) {
543         column = ( (Vector JavaDoc)vecColumns.get(i)).get(j).toString();
544         subValues.add(values.get(column));
545       }
546       vecValues.add(subValues);
547     }
548     this.subCounterKeyValues.put(tableName + "_" + tableID, vecValues);
549   }
550
551   /**
552    * This method set values for Counter columns
553    * @param tableName is table name
554    * @param tableID is table ID
555    */

556   public void setCounterValue(String JavaDoc tableName, String JavaDoc tableID) {
557     Vector JavaDoc targetCounterValue = new Vector JavaDoc();
558     Vector JavaDoc oldValues = getCounterValue(tableName, tableID);
559     Vector JavaDoc counterIncrement = getCounterIncrement(tableName, tableID);
560     for (int i = 0; i < counterIncrement.size(); i++) {
561       BigDecimal JavaDoc newValue = new BigDecimal JavaDoc(oldValues.get(i).toString());
562       newValue = newValue.add(new BigDecimal JavaDoc(counterIncrement.get(i).toString()));
563       targetCounterValue.addElement(newValue);
564     }
565     this.currentCounterValue.put(tableName + "_" + tableID, targetCounterValue);
566   }
567
568   /**
569    * This method set values for currentCounterValue parameter
570    * @param tableName is table name
571    * @param tableID is table ID
572    * @return Vector of current counter values for table - tableName
573    */

574   public Vector JavaDoc getCounterValue(String JavaDoc tableName, String JavaDoc tableID) {
575     return (Vector JavaDoc)this.currentCounterValue.get(tableName + "_" + tableID);
576   }
577
578   /**
579    * This method set values for currentCounterValue parameter
580    * @param tableName is table name
581    * @param tableID is table ID
582    * @param conn is connection to target database
583    * @param firstColumn is first column
584    * @throws SQLException
585    */

586   public void setTargetColumnStartValues(String JavaDoc tableName, String JavaDoc tableID, Connection JavaDoc conn,
587       int firstColumn) throws SQLException JavaDoc {
588     Vector JavaDoc values = new Vector JavaDoc();
589     //TODO ZORAN
590
Vector JavaDoc valuesFromTable = readCounter(tableName, tableID, conn, firstColumn);
591     for (int i = 0; i < this.getCounterName(tableName, tableID).size(); i++) {
592       if (this.getCounterStartValueReset(tableName,
593           tableID).get(i).toString().equalsIgnoreCase("true")) {
594         if (this.getCounterStartValue(tableName, tableID).get(i) != null) {
595           BigDecimal JavaDoc newValue = new BigDecimal JavaDoc( (this.getCounterStartValue(tableName,
596                                 tableID)).get(i).toString());
597           values.addElement(newValue);
598         } else
599           values.addElement(null);
600       } else if (this.getCounterStartValueReset(tableName,
601           tableID).get(i).toString().equalsIgnoreCase("false")) {
602         if (this.getCounterStartValue(tableName, tableID).get(i) != null) {
603           BigDecimal JavaDoc newValue = new BigDecimal JavaDoc(valuesFromTable.get(i).toString());
604           values.addElement(newValue);
605         } else
606           values.addElement(null);
607       }
608     }
609     this.currentCounterValue.put(tableName + "_" + tableID, values);
610   }
611
612   /**
613    * Method importValue reads values from desired XML tag and puts them into Vector.
614    * @param doc Parsed import XML file.
615    * @param tagName The name of XML tag.
616    * @param strAttrName The name of tag attribute which reads input strValue.
617    * @param iImportJobItem Number of ImportDefinition tag which is processed.
618    * @param defaultValue The default value of strattrname attribute.
619    * @return Vector of importing values.
620    */

621   private Vector JavaDoc importValue(Document JavaDoc doc, String JavaDoc tagName, String JavaDoc strAttrName,
622       int iImportJobItem, String JavaDoc defaultValue) {
623     Vector JavaDoc strValue = new Vector JavaDoc();
624     NodeList JavaDoc tagBasic = doc.getElementsByTagName("importDefinition");
625     if (tagBasic.getLength() != 0) {
626       Element JavaDoc docFragment = (Element JavaDoc)tagBasic.item(iImportJobItem);
627       NodeList JavaDoc tag = docFragment.getElementsByTagName(tagName);
628       for (int i = 0; i < tag.getLength(); i++) {
629         String JavaDoc nodeValue = "";
630         if (strAttrName != null) {
631           NamedNodeMap JavaDoc attrs = tag.item(i).getAttributes();
632           Node JavaDoc nodeResult = attrs.getNamedItem(strAttrName);
633           if (nodeResult != null)
634             nodeValue = nodeResult.getNodeValue();
635           else
636             nodeValue = defaultValue;
637           strValue.addElement(nodeValue);
638         } else {
639           NodeList JavaDoc nodeText = tag.item(i).getChildNodes();
640           if (nodeText.item(0) != null) {
641             nodeValue = nodeText.item(0).getNodeValue();
642             strValue.addElement(nodeValue);
643           }
644         }
645       }
646     }
647     return strValue;
648   }
649
650   /**
651    * Method importSubCounterKeyValue reads values from strAttrName attribute
652    * XML tag and puts them into Vector.
653    * @param doc Parsed import XML file.
654    * @param strAttrName The name of tag attribute which reads input strValue.
655    * @param iImportJobItem Number of ImportDefinition tag which is processed.
656    * @param iSubCounterItem Number of subCounterColumn tag which is processed.
657    * @return Vector of importing values.
658    */

659   private Vector JavaDoc importSubCounterKeyValue(Document JavaDoc doc, String JavaDoc strAttrName,
660       int iImportJobItem, int iSubCounterItem) {
661     Vector JavaDoc strValue = null;
662     NodeList JavaDoc tagBasic = doc.getElementsByTagName("importDefinition");
663     if (tagBasic.getLength() != 0) {
664       Element JavaDoc docFragment = (Element JavaDoc)tagBasic.item(iImportJobItem);
665       NodeList JavaDoc tag = docFragment.getElementsByTagName("subCounterColumn");
666       if (tag.getLength() != 0) {
667         Element JavaDoc docCounterColumn = (Element JavaDoc)tag.item(iSubCounterItem);
668         NodeList JavaDoc tagSubCounterColumn = docCounterColumn.getElementsByTagName("subCounterKeyColumn");
669         strValue = new Vector JavaDoc();
670         for (int i = 0; i < tagSubCounterColumn.getLength(); i++) {
671           String JavaDoc nodeValue = "";
672           if (strAttrName != null) {
673             NamedNodeMap JavaDoc attrs = tagSubCounterColumn.item(i).getAttributes();
674             Node JavaDoc nodeResult = attrs.getNamedItem(strAttrName);
675             if (nodeResult != null) {
676               nodeValue = nodeResult.getNodeValue();
677             } else
678               nodeValue = null;
679             strValue.addElement(nodeValue);
680
681           } else {
682             NodeList JavaDoc nodeText = tag.item(i).getChildNodes();
683             if (nodeText.item(0) != null) {
684               nodeValue = nodeText.item(0).getNodeValue();
685               strValue.addElement(nodeValue);
686             }
687           }
688         }
689       }
690     }
691     return strValue;
692   }
693
694 // /**
695
// * This method check the update operation
696
// * @param tableName is table name
697
// * @param tableID is table ID
698
// * @param conn is connection
699
// * @return true if update operation OK, false otherwise
700
// * @throws SQLException
701
// */
702
// public boolean updateCounter(String tableName, String tableID,
703
// Connection conn) throws SQLException {
704
//
705
// String strQuery = null;
706
//
707
// Vector counterNames = this.getCounterName(tableName, tableID);
708
// Vector counterValues = this.getCounterValue(tableName, tableID);
709
// Vector counterIncrements = this.getCounterIncrement(tableName, tableID);
710
// for (int i = 0; i < counterNames.size(); i++) {
711
// Statement stmt = conn.createStatement();
712
// BigDecimal newValue = new BigDecimal(counterValues.get(i).toString());
713
// strQuery = queryUpdateCounter(counterNames.get(i).toString(), newValue);
714
// stmt.executeUpdate(strQuery);
715
// stmt.close();
716
// }
717
// return true;
718
// }
719

720     /**
721       * This method check the update operation
722       * @param conn is connection
723       * @throws SQLException
724       */

725   public void updateCounter(Connection JavaDoc conn) throws SQLException JavaDoc{
726     String JavaDoc strQuery = "";
727     for (int i=0;i<this.vecTargetTableName.size();i++){
728         String JavaDoc tableName = this.vecTargetTableName.get(i).toString();
729             String JavaDoc tableID = this.vecTargetTableID.get(i).toString();
730             Vector JavaDoc counterNames = this.getCounterName(tableName, tableID);
731             Vector JavaDoc counterValues = this.getCounterValue(tableName, tableID);
732             Vector JavaDoc counterIncrements = this.getCounterIncrement(tableName, tableID);
733             for (int j = 0; j < counterNames.size(); j++) {
734                 Statement JavaDoc stmt = conn.createStatement();
735                 BigDecimal JavaDoc newValue = new BigDecimal JavaDoc(counterValues.get(i).toString());
736                 strQuery = queryUpdateCounter(counterNames.get(i).toString(), newValue);
737                 stmt.executeUpdate(strQuery);
738                 stmt.close();
739             }
740     }
741   }
742
743   /**
744    * This method sets the value of counter parameter
745    * @param tableName is table name
746    * @param tableID is table ID
747    * @param conn is connection
748    * @return true
749    * @throws SQLException
750    */

751   private boolean insertCounter(String JavaDoc tableName, String JavaDoc tableID,
752       Connection JavaDoc conn) throws SQLException JavaDoc {
753
754     String JavaDoc strQuery = null;
755
756     Vector JavaDoc counterNames = this.getCounterName(tableName, tableID);
757     Vector JavaDoc startValues = this.getCounterIncrement(tableName, tableID);
758     for (int i = 0; i < counterNames.size(); i++) {
759       Statement JavaDoc stmt = conn.createStatement();
760       BigDecimal JavaDoc newValue = new BigDecimal JavaDoc(startValues.get(i).toString());
761       strQuery = queryInsertCounter(counterNames.get(i).toString(), newValue);
762       stmt.execute(strQuery);
763       stmt.close();
764     }
765     return true;
766   }
767
768   /**
769    * This method read value of counter parameter
770    * @param tableName is table name
771    * @param tableID is table ID
772    * @param conn is connection
773    * @param firstColumn is first column
774    * @return true
775    * @throws SQLException
776    */

777   private Vector JavaDoc readCounter(String JavaDoc tableName, String JavaDoc tableID, Connection JavaDoc conn,
778       int firstColumn) throws SQLException JavaDoc {
779
780     String JavaDoc strQuery = null;
781     BigDecimal JavaDoc value = new BigDecimal JavaDoc(0);
782     Vector JavaDoc startValues = new Vector JavaDoc();
783     Vector JavaDoc counterNames = this.getCounterName(tableName, tableID);
784     Vector JavaDoc counterValues = this.getCounterValue(tableName, tableID);
785     Vector JavaDoc counterIncrements = this.getCounterIncrement(tableName, tableID);
786     Vector JavaDoc defaultStartValues = this.getCounterIncrement(tableName, tableID);
787
788     for (int i = 0; i < counterNames.size(); i++) {
789       Statement JavaDoc stmt = conn.createStatement();
790       strQuery = querySelectCounter(counterNames.get(i).toString());
791         this.logger.write("full", "\tQuery '" + strQuery + "' will be executed");
792       ResultSet JavaDoc rset = stmt.executeQuery(strQuery);
793       if (rset.next()) {
794         if (firstColumn == 0)
795           value = new BigDecimal JavaDoc(rset.getString(0));
796         else
797           value = new BigDecimal JavaDoc(rset.getString(1));
798       } else {
799         insertCounter(tableName, tableID, conn);
800         value = new BigDecimal JavaDoc(defaultStartValues.get(i).toString());
801       }
802       stmt.close();
803       rset.close();
804       startValues.addElement(value);
805
806     }
807     return startValues;
808   }
809
810   /**
811    *
812    * @param counterColumnName is name of the column
813    * @return query
814    */

815   private String JavaDoc querySelectCounter(String JavaDoc counterColumnName) {
816     String JavaDoc query = "select ";
817
818     query += this.counterValueColumn + " from " + this.counterTableName + " where " +
819         this.counterNameColumn + " = '" + counterColumnName + "'";
820     return query;
821   }
822
823   /**
824    *
825    * @param counterColumnName is column name
826    * @param counterColumnValue is column value
827    * @return query
828    */

829   private String JavaDoc queryInsertCounter(String JavaDoc counterColumnName, BigDecimal JavaDoc counterColumnValue) {
830     String JavaDoc query = "INSERT into ";
831
832     query += this.counterTableName + " (" + this.counterNameColumn + ", " + this.counterValueColumn
833         + ") VALUES('" +
834         counterColumnName + "', " + counterColumnValue.intValue() + ")";
835     return query;
836   }
837
838   /**
839    *
840    * @param counterColumnName is colulmn name
841    * @param newValue is column value
842    * @return query
843    */

844
845   private String JavaDoc queryUpdateCounter(String JavaDoc counterColumnName, BigDecimal JavaDoc newValue) {
846     String JavaDoc query = "update ";
847     query += this.counterTableName + " set " +
848         this.counterValueColumn + " = " + newValue.toString() + " where " +
849         this.counterNameColumn + " = '" + counterColumnName + "'";
850     return query;
851   }
852
853   /**
854    * This method read value of sub counter parameter
855    * @param tableName is table name
856    * @param tableID is table ID
857    * @param conn is connection
858    * @param firstColumn is first column
859    * @return vector
860    * @throws SQLException
861    */

862   public Vector JavaDoc readSubCounterValue(String JavaDoc tableName, String JavaDoc tableID, Connection JavaDoc conn,
863       int firstColumn, String JavaDoc tableMode, ConfigReader targetConfigReader) throws SQLException JavaDoc, LoaderException {
864
865     BigDecimal JavaDoc value = new BigDecimal JavaDoc(0);
866     Vector JavaDoc startValues = new Vector JavaDoc();
867
868     this.logger.write("full", "\treadSubCounterValue method is started");
869
870     Vector JavaDoc columns = this.getSubCounterKeyColumns(tableName, tableID);
871     Vector JavaDoc typs = this.getSubCounterKeyColumnsTyp(tableName, tableID);
872     Vector JavaDoc subColumnNames = this.getSubTargetColumnName(tableName, tableID);
873     Vector JavaDoc subIncrement = this.getSubCounterIncrement(tableName, tableID);
874     Vector JavaDoc subCounterStartValues = this.getSubCounterStartValue(tableName, tableID);
875     Vector JavaDoc subCounterKeyColumnValues = this.getSubCounterKeyValues(tableName, tableID);
876
877     for (int i = 0; i < subColumnNames.size(); i++) {
878
879       String JavaDoc strQuery = "select ";
880       Statement JavaDoc stmt = conn.createStatement();
881       strQuery += subColumnNames.get(i).toString() + " from " + tableName + " where ";
882       for (int j = 0; j < ( (Vector JavaDoc)columns.get(i)).size(); j++) {
883         if ( ( (Vector JavaDoc)subCounterKeyColumnValues.get(i)).get(j) != null &&
884             !( (Vector JavaDoc)subCounterKeyColumnValues.get(i)).get(j).toString().equalsIgnoreCase("")) {
885 //ZK change this from CheckType to targetConfigReader
886
try {
887             if (!targetConfigReader.isNumber( ( (Vector JavaDoc)typs.get(i)).get(j).toString()))
888                 strQuery += ( (Vector JavaDoc)columns.get(i)).get(j).toString() + " = '"
889                     + ( (Vector JavaDoc)subCounterKeyColumnValues.get(i)).get(j).toString() + "' and ";
890               else
891                 strQuery += ( (Vector JavaDoc)columns.get(i)).get(j).toString() + " = "
892                     + ( (Vector JavaDoc)subCounterKeyColumnValues.get(i)).get(j).toString() + " and ";
893         } catch (LoaderException e) {
894            LoaderException le= new LoaderException("Exception:This sql type isn't present in conf file for target database. Yuo must add it into conf file.",(Throwable JavaDoc)e);
895            throw le;
896         }
897         } else
898           strQuery += ( (Vector JavaDoc)columns.get(i)).get(j).toString() + " is null and ";
899       }
900
901       if (strQuery.endsWith(" and "))
902         strQuery = strQuery.substring(0, strQuery.length() - 5);
903
904       if (tableMode.equalsIgnoreCase("cache")) {
905         //caching the subcounter value
906
Object JavaDoc obj = subCounterCache.get(strQuery);
907         if (obj == null) { //query isn't cached before
908
this.logger.write("full", "\tQuery '" + strQuery + "' will be executed");
909           ResultSet JavaDoc rset = stmt.executeQuery(strQuery);
910           BigDecimal JavaDoc currentValue = new BigDecimal JavaDoc(0);
911           if (rset.next()) {
912             if (firstColumn == 0) {
913               value = new BigDecimal JavaDoc(rset.getString(0));
914               currentValue = value;
915               while (rset.next()) {
916                 value = new BigDecimal JavaDoc(rset.getString(0));
917                 if (currentValue.intValue() < value.intValue())
918                   currentValue = value;
919               }
920             } else { //firstColumnResult==1
921
value = new BigDecimal JavaDoc(rset.getString(1));
922               currentValue = value;
923               while (rset.next()) {
924                 value = new BigDecimal JavaDoc(rset.getString(1));
925                 if (currentValue.intValue() < value.intValue())
926                   currentValue = value;
927               }
928             }
929             value = value.add(new BigDecimal JavaDoc(subIncrement.get(i).toString()));
930           } else {
931             value = new BigDecimal JavaDoc(subCounterStartValues.get(i).toString());
932           }
933           subCounterCache.put(strQuery, value);
934           stmt.close();
935         } else { //query is cached before
936
BigDecimal JavaDoc oldValue = (BigDecimal JavaDoc)obj;
937           value = oldValue.add(new BigDecimal JavaDoc(subIncrement.get(i).toString()));
938           subCounterCache.remove(strQuery);
939           subCounterCache.put(strQuery, value);
940         }
941       } else {//tableMode=query
942
this.logger.write("full", "\tQuery '" + strQuery + "' will be executed");
943         ResultSet JavaDoc rset = stmt.executeQuery(strQuery);
944         BigDecimal JavaDoc currentValue = new BigDecimal JavaDoc(0);
945         if (rset.next()) {
946           if (firstColumn == 0) {
947             value = new BigDecimal JavaDoc(rset.getString(0));
948             currentValue = value;
949             while (rset.next()) {
950               value = new BigDecimal JavaDoc(rset.getString(0));
951               if (currentValue.intValue() < value.intValue())
952                 currentValue = value;
953             }
954           } else { //firstColumnResult==1
955
value = new BigDecimal JavaDoc(rset.getString(1));
956             currentValue = value;
957             while (rset.next()) {
958               value = new BigDecimal JavaDoc(rset.getString(1));
959               if (currentValue.intValue() < value.intValue())
960                 currentValue = value;
961             }
962           }
963           value = value.add(new BigDecimal JavaDoc(subIncrement.get(i).toString()));
964         } else {
965           value = new BigDecimal JavaDoc(subCounterStartValues.get(i).toString());
966         }
967         stmt.close();
968
969       }
970       startValues.addElement(value);
971     }
972     this.logger.write("full", "\treadSubCounterValue method is finished");
973     return startValues;
974   }
975
976   /**
977    * This method reset cach for subcounter
978    */

979   public void resetSubCounterCache(){
980     if(this.subCounterCache.size()>0)
981       this.subCounterCache.clear();
982   }
983
984
985   /**
986    * Method importAttributeValue reads value for strAttrName attribute in strTagName tag.
987    * This method return this value.
988    * @param doc Parsed import XML file.
989    * @param strTagName The name of tag where attribute is situated.
990    * @param strAttrName The name of tag attribute which reads input value.
991    * @param iImportJobItem Number of ImportDefinition tag which is processed.
992    * @return String - importing value.
993    */

994   private String JavaDoc importAttributeValue(Document JavaDoc doc, String JavaDoc strTagName, String JavaDoc strAttrName,
995       int iImportJobItem) {
996     String JavaDoc strValue = "";
997     NodeList JavaDoc tagBasic = doc.getElementsByTagName("importDefinition");
998     if (tagBasic.getLength() != 0) {
999       Element JavaDoc docFragment = (Element JavaDoc)tagBasic.item(iImportJobItem);
1000// NodeList tag = docFragment.getElementsByTagName(tagName);
1001
// for (int i = 0; i < tag.getLength(); i++) {
1002

1003      tagBasic = docFragment.getElementsByTagName(strTagName);
1004      if (tagBasic.getLength() != 0) {
1005        docFragment = (Element JavaDoc)tagBasic.item(0);
1006        if (docFragment != null)
1007          strValue = docFragment.getAttribute(strAttrName);
1008      }
1009    }
1010    return strValue;
1011  }
1012
1013  /**
1014   * Method counterColumnTypes is used to put types of constant columns into
1015   * global vector sorted in target tables. If there is an error, Exception
1016   * "SQLException" or "NullPointerException" is thrown.
1017   * @param c Connection to target database.
1018   * @param tableName is table name
1019   * @param tableID is table ID
1020   * @param firstColumn is first column
1021   * @throws SQLException Constructs an SQLException object with a reason.
1022   * @throws NullPointerException Constructs a NullPointerException with the specified detail message.
1023   */

1024  public void counterColumnTypes(String JavaDoc tableName, String JavaDoc tableID, Connection JavaDoc c,
1025      int firstColumn, boolean columnsSuportedTarget, ConfigReader configReaderTarget) throws SQLException JavaDoc, NullPointerException JavaDoc {
1026    int iCnt = 0;
1027    try {
1028      Vector JavaDoc columnNames = this.getSubCounterKeyColumns(tableName, tableID);
1029      Statement JavaDoc stmtConstant = c.createStatement();
1030      Vector JavaDoc typs = new Vector JavaDoc();
1031      Vector JavaDoc subTyps = new Vector JavaDoc();
1032      String JavaDoc strQuery = "select ";
1033        ResultSet JavaDoc rsetConstant=null;
1034      
1035      if (columnNames.size() != 0) {
1036        for (int i = 0; i < columnNames.size(); i++) {
1037          for (int j = 0; j < ( (Vector JavaDoc)columnNames.get(i)).size(); j++) {
1038            strQuery += ( (Vector JavaDoc)columnNames.get(i)).get(j).toString() +
1039                ", ";
1040          }
1041          strQuery = strQuery.substring(0, strQuery.length() - 2);
1042          strQuery += " from " + tableName;
1043//ZK change this. Because of problems with getColumnTypeName()method. Some drivers doesn't support it.
1044
//start
1045
if (columnsSuportedTarget){
1046                  
1047                        rsetConstant = c.getMetaData().getColumns( c.getCatalog(), null, tableName, "%" );
1048                        String JavaDoc columnName = "";
1049                        String JavaDoc columnType = "";
1050                        while(rsetConstant.next()){
1051                            columnName = rsetConstant.getString(3+firstColumn);
1052                            columnType = rsetConstant.getString(5+firstColumn);
1053                            Vector JavaDoc temp = (Vector JavaDoc)columnNames.get(i);
1054                            for (int j = 0; j < temp.size(); j++) {
1055                                    if( temp.get(j).toString().equalsIgnoreCase( columnName ) ){
1056                                        typs.add(columnType);
1057                                    }
1058                            }
1059                        }
1060        }else{//TODO ZK ADDED stmtConstant.setMaxRows(1). Place this as parameter in conf file, like maxRowsSuported
1061
if (configReaderTarget.getMaxRowsSupported()){
1062                 stmtConstant.setMaxRows(1);
1063                }
1064             rsetConstant = stmtConstant.executeQuery(strQuery);
1065             
1066             for (int j = 0; j < ( (Vector JavaDoc)columnNames.get(i)).size(); j++) {
1067
1068              typs.add(rsetConstant.getMetaData().getColumnTypeName(j + firstColumn));
1069          }
1070
1071          }
1072          rsetConstant.close();
1073          subTyps.addElement(typs);
1074        }
1075      }
1076      this.subCounterKeyColumnsTyp.put(tableName + "_" + tableID, subTyps);
1077      stmtConstant.close();
1078
1079    }
1080    catch (SQLException JavaDoc ex) {
1081      throw ex;
1082    }
1083    catch (NullPointerException JavaDoc ex) {
1084      throw ex;
1085    }
1086  }
1087
1088  /**
1089   * This method reset all variables
1090   */

1091  public void reset() {
1092    this.counterTableName = null;
1093    this.counterNameColumn = null;
1094    this.counterValueColumn = null;
1095    this.counterName = new Hashtable JavaDoc();
1096    this.counterStartValue = new Hashtable JavaDoc();
1097    this.counterIncrement = new Hashtable JavaDoc();
1098    this.targetColumnName = new Hashtable JavaDoc();
1099    this.targetColumnTyp = new Hashtable JavaDoc();
1100    this.valueMode = new Hashtable JavaDoc();
1101    this.counterStartValueReset = new Hashtable JavaDoc();
1102
1103    this.subCounterName = new Hashtable JavaDoc();
1104    this.subCounterStartValue = new Hashtable JavaDoc();
1105    this.subCounterIncrement = new Hashtable JavaDoc();
1106    this.subTargetColumnName = new Hashtable JavaDoc();
1107    this.subValueMode = new Hashtable JavaDoc();
1108    this.subCounterKeyColumns = new Hashtable JavaDoc();
1109    this.subCounterKeyValues = new Hashtable JavaDoc();
1110    this.subCounterKeyColumnsTyp = new Hashtable JavaDoc();
1111    this.subTargetColumnTyp = new Hashtable JavaDoc();
1112
1113    this.vecCounterName = new Vector JavaDoc();
1114    this.vecCounterIncrement = new Vector JavaDoc();
1115    this.vecCounterStartValue = new Vector JavaDoc();
1116    this.vecTargetColumnName = new Vector JavaDoc();
1117    this.vecValueMode = new Vector JavaDoc();
1118    this.vecCounterStartValueReset = new Vector JavaDoc();
1119    this.vecTargetTableName = new Vector JavaDoc();
1120    this.vecTargetTableID = new Vector JavaDoc();
1121    this.currentCounterValue = new Hashtable JavaDoc();
1122
1123    this.vecSubCounterName = new Vector JavaDoc();
1124    this.vecSubCounterIncrement = new Vector JavaDoc();
1125    this.vecSubCounterStartValue = new Vector JavaDoc();
1126    this.vecSubTargetTableName = new Vector JavaDoc();
1127    this.vecSubTargetTableID = new Vector JavaDoc();
1128    this.vecSubTargetColumnName = new Vector JavaDoc();
1129    this.vecSubValueMode = new Vector JavaDoc();
1130    this.vecSubKeyColumns = new Vector JavaDoc();
1131    this.vecSubKeyColumnsTyp = new Vector JavaDoc();
1132    this.subCounterCache.clear();
1133  }
1134}
1135
Popular Tags