Project

General

Profile

Download (1.68 KB) Statistics
| Branch: | Tag: | Revision:
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
package eu.etaxonomy.cdm.io.common.mapping.out;
10

    
11
import java.sql.PreparedStatement;
12

    
13
import org.apache.logging.log4j.LogManager;
14
import org.apache.logging.log4j.Logger;
15

    
16
import eu.etaxonomy.cdm.io.common.DbExportStateBase;
17

    
18
/**
19
 * @author a.mueller
20
 * @since 12.05.2009
21
 */
22
public class DbExportMapperBase<STATE extends DbExportStateBase<?, IExportTransformer>>  /*implements IDbExportMapper */{
23

    
24
    @SuppressWarnings("unused")
25
	private static final Logger logger = LogManager.getLogger();
26

    
27
	protected PreparedStatement preparedStatement = null;
28
	protected int index = 0;
29
	private STATE state;
30
	private String tableName;
31

    
32
	public void initialize(PreparedStatement stmt, IndexCounter index, STATE state, String tableName) {
33
		this.preparedStatement = stmt;
34
		this.index = index.getIncreasing();
35
		this.state = state;
36
		this.tableName = tableName;
37
	}
38

    
39
	/**
40
	 * Initialize the mapper in a way that it does not add any data
41
	 * to the prepared statement.
42
	 */
43
	public void initializeNull(PreparedStatement stmt, STATE state, String tableName) {
44
		this.preparedStatement = stmt;
45
		this.index = -1;
46
		this.state = state;
47
		this.tableName = tableName;
48
	}
49

    
50
	public PreparedStatement getPreparedStatement() {
51
		return preparedStatement;
52
	}
53

    
54
	public int getIndex() {
55
		return index;
56
	}
57

    
58
	public STATE getState() {
59
		return state;
60
	}
61

    
62
	public String getTableName() {
63
		return tableName;
64
	}
65
	public void setTableName(String tableName) {
66
		this.tableName = tableName;
67
	}
68
}
(14-14/44)