1
|
/**
|
2
|
* Copyright (C) 2007 EDIT
|
3
|
* European Distributed Institute of Taxonomy
|
4
|
* http://www.e-taxonomy.eu
|
5
|
*
|
6
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
7
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
8
|
*/
|
9
|
|
10
|
package eu.etaxonomy.cdm.io.common.mapping.out;
|
11
|
|
12
|
import java.sql.PreparedStatement;
|
13
|
|
14
|
import org.apache.log4j.Logger;
|
15
|
|
16
|
import eu.etaxonomy.cdm.io.common.DbExportStateBase;
|
17
|
|
18
|
/**
|
19
|
* @author a.mueller
|
20
|
* @created 12.05.2009
|
21
|
* @version 1.0
|
22
|
*/
|
23
|
/**
|
24
|
* @author a.mueller
|
25
|
* @created 12.05.2009
|
26
|
* @version 1.0
|
27
|
*/
|
28
|
public class DbExportMapperBase<STATE extends DbExportStateBase<?, IExportTransformer>> /*implements IDbExportMapper */{
|
29
|
@SuppressWarnings("unused")
|
30
|
private static final Logger logger = Logger.getLogger(DbExportMapperBase.class);
|
31
|
|
32
|
protected PreparedStatement preparedStatement = null;
|
33
|
protected int index = 0;
|
34
|
private STATE state;
|
35
|
private String tableName;
|
36
|
|
37
|
|
38
|
|
39
|
|
40
|
/* (non-Javadoc)
|
41
|
* @see eu.etaxonomy.cdm.io.berlinModel.out.mapper.IDbExportMapper#initialize(java.sql.PreparedStatement, int)
|
42
|
*/
|
43
|
public void initialize(PreparedStatement stmt, IndexCounter index, STATE state, String tableName) {
|
44
|
this.preparedStatement = stmt;
|
45
|
this.index = index.getIncreasing();
|
46
|
this.state = state;
|
47
|
this.tableName = tableName;
|
48
|
}
|
49
|
|
50
|
|
51
|
public void initializeNull(PreparedStatement stmt, STATE state, String tableName) {
|
52
|
this.preparedStatement = stmt;
|
53
|
this.index = -1;
|
54
|
this.state = state;
|
55
|
this.tableName = tableName;
|
56
|
}
|
57
|
|
58
|
|
59
|
/**
|
60
|
* @return the preparedStatement
|
61
|
*/
|
62
|
public PreparedStatement getPreparedStatement() {
|
63
|
return preparedStatement;
|
64
|
}
|
65
|
|
66
|
/**
|
67
|
* @return the index
|
68
|
*/
|
69
|
public int getIndex() {
|
70
|
return index;
|
71
|
}
|
72
|
|
73
|
|
74
|
/**
|
75
|
* @return the state
|
76
|
*/
|
77
|
public STATE getState() {
|
78
|
return state;
|
79
|
}
|
80
|
|
81
|
|
82
|
/**
|
83
|
* @return the tableName
|
84
|
*/
|
85
|
public String getTableName() {
|
86
|
return tableName;
|
87
|
}
|
88
|
|
89
|
|
90
|
/**
|
91
|
* @param tableName the tableName to set
|
92
|
*/
|
93
|
public void setTableName(String tableName) {
|
94
|
this.tableName = tableName;
|
95
|
}
|
96
|
}
|